]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: bcm2835-audio: Drop superfluous mutex lock during prepare
authorTakashi Iwai <tiwai@suse.de>
Tue, 4 Sep 2018 15:58:45 +0000 (17:58 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Sep 2018 09:14:59 +0000 (11:14 +0200)
The chip->audio_mutex is used basically for protecting the opened
stream assignment, and the prepare callback is irrelevant with it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c

index 1f9c940f1cc33e1332da588e0d8970bcdbfa6130..9659c25b9f9dddc4ea5f58b6fd3a3ed2b76b0d8d 100644 (file)
@@ -218,8 +218,6 @@ static int snd_bcm2835_pcm_prepare(struct snd_pcm_substream *substream)
        int channels;
        int err;
 
-       mutex_lock(&chip->audio_mutex);
-
        /* notify the vchiq that it should enter spdif passthrough mode by
         * setting channels=0 (see
         * https://github.com/raspberrypi/linux/issues/528)
@@ -233,7 +231,7 @@ static int snd_bcm2835_pcm_prepare(struct snd_pcm_substream *substream)
                                       runtime->rate,
                                       snd_pcm_format_width(runtime->format));
        if (err < 0)
-               goto out;
+               return err;
 
        memset(&alsa_stream->pcm_indirect, 0, sizeof(alsa_stream->pcm_indirect));
 
@@ -246,9 +244,7 @@ static int snd_bcm2835_pcm_prepare(struct snd_pcm_substream *substream)
        alsa_stream->pos = 0;
        alsa_stream->draining = false;
 
- out:
-       mutex_unlock(&chip->audio_mutex);
-       return err;
+       return 0;
 }
 
 static void snd_bcm2835_pcm_transfer(struct snd_pcm_substream *substream,