diff options
Diffstat (limited to 'sound/firewire/tascam/amdtp-tascam.c')
| -rw-r--r-- | sound/firewire/tascam/amdtp-tascam.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sound/firewire/tascam/amdtp-tascam.c b/sound/firewire/tascam/amdtp-tascam.c index 0b42d6559008..59c339d9b5fb 100644 --- a/sound/firewire/tascam/amdtp-tascam.c +++ b/sound/firewire/tascam/amdtp-tascam.c @@ -157,15 +157,14 @@ static void read_status_messages(struct amdtp_stream *s, if ((before ^ after) & mask) { struct snd_firewire_tascam_change *entry = &tscm->queue[tscm->push_pos]; - unsigned long flag; - spin_lock_irqsave(&tscm->lock, flag); - entry->index = index; - entry->before = before; - entry->after = after; - if (++tscm->push_pos >= SND_TSCM_QUEUE_COUNT) - tscm->push_pos = 0; - spin_unlock_irqrestore(&tscm->lock, flag); + scoped_guard(spinlock_irqsave, &tscm->lock) { + entry->index = index; + entry->before = before; + entry->after = after; + if (++tscm->push_pos >= SND_TSCM_QUEUE_COUNT) + tscm->push_pos = 0; + } wake_up(&tscm->hwdep_wait); } @@ -238,7 +237,7 @@ int amdtp_tscm_init(struct amdtp_stream *s, struct fw_unit *unit, err = amdtp_stream_init(s, unit, dir, flags, fmt, process_ctx_payloads, sizeof(struct amdtp_tscm)); if (err < 0) - return 0; + return err; if (dir == AMDTP_OUT_STREAM) { // Use fixed value for FDF field. |
