diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2014-06-04 15:25:32 +0900 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-06-04 14:35:24 +0200 |
commit | c6e5e741c6dc8e13a47721f419e26e6ac19ecaf4 (patch) | |
tree | fa3086fe18bbf74fd126a04e5f869297ffe78a44 /sound/firewire/bebob | |
parent | 21fd3e956ee8a307a06bc6e095f5767a00eb2a7e (diff) | |
download | blackbird-op-linux-c6e5e741c6dc8e13a47721f419e26e6ac19ecaf4.tar.gz blackbird-op-linux-c6e5e741c6dc8e13a47721f419e26e6ac19ecaf4.zip |
ALSA: fireworks/bebob: Shorten critical section for stream_stop_duplex()
All assignment for local variables in these functions are not related to
critical section.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/bebob')
-rw-r--r-- | sound/firewire/bebob/bebob_stream.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c index bc4f82776fda..ef4d0c9f6578 100644 --- a/sound/firewire/bebob/bebob_stream.c +++ b/sound/firewire/bebob/bebob_stream.c @@ -655,8 +655,6 @@ void snd_bebob_stream_stop_duplex(struct snd_bebob *bebob) struct amdtp_stream *master, *slave; atomic_t *master_substreams, *slave_substreams; - mutex_lock(&bebob->mutex); - if (bebob->master == &bebob->rx_stream) { slave = &bebob->tx_stream; master = &bebob->rx_stream; @@ -669,6 +667,8 @@ void snd_bebob_stream_stop_duplex(struct snd_bebob *bebob) master_substreams = &bebob->capture_substreams; } + mutex_lock(&bebob->mutex); + if (atomic_read(slave_substreams) == 0) { amdtp_stream_pcm_abort(slave); amdtp_stream_stop(slave); |