mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-28 22:54:05 +08:00
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>
This commit is contained in:
parent
21fd3e956e
commit
c6e5e741c6
@ -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);
|
||||
|
@ -284,8 +284,6 @@ void snd_efw_stream_stop_duplex(struct snd_efw *efw)
|
||||
struct amdtp_stream *master, *slave;
|
||||
atomic_t *master_substreams, *slave_substreams;
|
||||
|
||||
mutex_lock(&efw->mutex);
|
||||
|
||||
if (efw->master == &efw->rx_stream) {
|
||||
slave = &efw->tx_stream;
|
||||
master = &efw->rx_stream;
|
||||
@ -298,6 +296,8 @@ void snd_efw_stream_stop_duplex(struct snd_efw *efw)
|
||||
master_substreams = &efw->capture_substreams;
|
||||
}
|
||||
|
||||
mutex_lock(&efw->mutex);
|
||||
|
||||
if (atomic_read(slave_substreams) == 0) {
|
||||
stop_stream(efw, slave);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user