From 2a71e701660d7aa9ce1a740588dbf13b975deb10 Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Sat, 20 Feb 2016 16:18:57 +0900 Subject: ALSA: bebob: move mutex from function callee 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 substream 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 Signed-off-by: Takashi Iwai --- sound/firewire/bebob/bebob_stream.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'sound/firewire/bebob/bebob_stream.c') diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c index 073ad6d8a76e..6809913110f4 100644 --- a/sound/firewire/bebob/bebob_stream.c +++ b/sound/firewire/bebob/bebob_stream.c @@ -589,8 +589,6 @@ int snd_bebob_stream_start_duplex(struct snd_bebob *bebob, unsigned int rate) unsigned int curr_rate; int err = 0; - mutex_lock(&bebob->mutex); - /* Need no substreams */ if (atomic_read(&bebob->substreams_counter) == 0) goto end; @@ -722,7 +720,6 @@ int snd_bebob_stream_start_duplex(struct snd_bebob *bebob, unsigned int rate) } } end: - mutex_unlock(&bebob->mutex); return err; } @@ -738,8 +735,6 @@ void snd_bebob_stream_stop_duplex(struct snd_bebob *bebob) master = &bebob->tx_stream; } - mutex_lock(&bebob->mutex); - if (atomic_read(&bebob->substreams_counter) == 0) { amdtp_stream_pcm_abort(master); amdtp_stream_stop(master); @@ -749,8 +744,6 @@ void snd_bebob_stream_stop_duplex(struct snd_bebob *bebob) break_both_connections(bebob); } - - mutex_unlock(&bebob->mutex); } void snd_bebob_stream_update_duplex(struct snd_bebob *bebob) -- cgit v1.2.3