diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2014-06-04 02:25:32 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-06-04 08:35:24 -0400 |
commit | c6e5e741c6dc8e13a47721f419e26e6ac19ecaf4 (patch) | |
tree | fa3086fe18bbf74fd126a04e5f869297ffe78a44 /sound | |
parent | 21fd3e956ee8a307a06bc6e095f5767a00eb2a7e (diff) |
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')
-rw-r--r-- | sound/firewire/bebob/bebob_stream.c | 4 | ||||
-rw-r--r-- | sound/firewire/fireworks/fireworks_stream.c | 4 |
2 files changed, 4 insertions, 4 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) | |||
655 | struct amdtp_stream *master, *slave; | 655 | struct amdtp_stream *master, *slave; |
656 | atomic_t *master_substreams, *slave_substreams; | 656 | atomic_t *master_substreams, *slave_substreams; |
657 | 657 | ||
658 | mutex_lock(&bebob->mutex); | ||
659 | |||
660 | if (bebob->master == &bebob->rx_stream) { | 658 | if (bebob->master == &bebob->rx_stream) { |
661 | slave = &bebob->tx_stream; | 659 | slave = &bebob->tx_stream; |
662 | master = &bebob->rx_stream; | 660 | master = &bebob->rx_stream; |
@@ -669,6 +667,8 @@ void snd_bebob_stream_stop_duplex(struct snd_bebob *bebob) | |||
669 | master_substreams = &bebob->capture_substreams; | 667 | master_substreams = &bebob->capture_substreams; |
670 | } | 668 | } |
671 | 669 | ||
670 | mutex_lock(&bebob->mutex); | ||
671 | |||
672 | if (atomic_read(slave_substreams) == 0) { | 672 | if (atomic_read(slave_substreams) == 0) { |
673 | amdtp_stream_pcm_abort(slave); | 673 | amdtp_stream_pcm_abort(slave); |
674 | amdtp_stream_stop(slave); | 674 | amdtp_stream_stop(slave); |
diff --git a/sound/firewire/fireworks/fireworks_stream.c b/sound/firewire/fireworks/fireworks_stream.c index 541569022a7c..b985fc5ebdc6 100644 --- a/sound/firewire/fireworks/fireworks_stream.c +++ b/sound/firewire/fireworks/fireworks_stream.c | |||
@@ -284,8 +284,6 @@ void snd_efw_stream_stop_duplex(struct snd_efw *efw) | |||
284 | struct amdtp_stream *master, *slave; | 284 | struct amdtp_stream *master, *slave; |
285 | atomic_t *master_substreams, *slave_substreams; | 285 | atomic_t *master_substreams, *slave_substreams; |
286 | 286 | ||
287 | mutex_lock(&efw->mutex); | ||
288 | |||
289 | if (efw->master == &efw->rx_stream) { | 287 | if (efw->master == &efw->rx_stream) { |
290 | slave = &efw->tx_stream; | 288 | slave = &efw->tx_stream; |
291 | master = &efw->rx_stream; | 289 | master = &efw->rx_stream; |
@@ -298,6 +296,8 @@ void snd_efw_stream_stop_duplex(struct snd_efw *efw) | |||
298 | master_substreams = &efw->capture_substreams; | 296 | master_substreams = &efw->capture_substreams; |
299 | } | 297 | } |
300 | 298 | ||
299 | mutex_lock(&efw->mutex); | ||
300 | |||
301 | if (atomic_read(slave_substreams) == 0) { | 301 | if (atomic_read(slave_substreams) == 0) { |
302 | stop_stream(efw, slave); | 302 | stop_stream(efw, slave); |
303 | 303 | ||