diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2015-11-14 10:54:50 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-11-14 19:53:41 +0300 |
commit | ea54a37442639cf884918de69db46caf693490f8 (patch) | |
tree | d680a3337db1051284f9203003abe1a4767d6020 /sound/firewire/fireworks/fireworks_stream.c | |
parent | 5d5563b14fe34021b690eb3edc54abcc876e417c (diff) | |
download | linux-ea54a37442639cf884918de69db46caf693490f8.tar.xz |
ALSA: fireworks: move mutex from function callees to callers
Currently, critical section is protected by mutex in functions of
fireworks_stream.c. Callers increments/decrements substreams counter
before calling the functions. Moving mutex to the callers code allows
to change type of the substeram counter from atomic_t to unsigned int.
This commit is a preparation for obsoleting usage of atomic_t for
substream counter.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/fireworks/fireworks_stream.c')
-rw-r--r-- | sound/firewire/fireworks/fireworks_stream.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/sound/firewire/fireworks/fireworks_stream.c b/sound/firewire/fireworks/fireworks_stream.c index 759f6e3ed44a..69307452dee7 100644 --- a/sound/firewire/fireworks/fireworks_stream.c +++ b/sound/firewire/fireworks/fireworks_stream.c @@ -214,8 +214,6 @@ int snd_efw_stream_start_duplex(struct snd_efw *efw, unsigned int rate) unsigned int curr_rate; int err = 0; - mutex_lock(&efw->mutex); - /* Need no substreams */ if ((atomic_read(&efw->playback_substreams) == 0) && (atomic_read(&efw->capture_substreams) == 0)) @@ -286,7 +284,6 @@ int snd_efw_stream_start_duplex(struct snd_efw *efw, unsigned int rate) } } end: - mutex_unlock(&efw->mutex); return err; } @@ -307,16 +304,12 @@ 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); if (atomic_read(master_substreams) == 0) stop_stream(efw, master); } - - mutex_unlock(&efw->mutex); } void snd_efw_stream_update_duplex(struct snd_efw *efw) |