a70081159f2521ceceed93b62708dd97202ba1cd
[oweals/openwrt.git] /
1 From 3c7663a9b1763f64250db4b975a3ce246ef32e0f Mon Sep 17 00:00:00 2001
2 From: Takashi Iwai <tiwai@suse.de>
3 Date: Tue, 4 Sep 2018 17:58:45 +0200
4 Subject: [PATCH] staging: bcm2835-audio: Drop superfluous mutex lock
5  during prepare
6
7 commit f0eb15d055380ff127e5f12c8fad2b36bdb3c006 upstream.
8
9 The chip->audio_mutex is used basically for protecting the opened
10 stream assignment, and the prepare callback is irrelevant with it.
11
12 Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
14 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15 ---
16  drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c | 8 ++------
17  1 file changed, 2 insertions(+), 6 deletions(-)
18
19 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
20 +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
21 @@ -218,8 +218,6 @@ static int snd_bcm2835_pcm_prepare(struc
22         int channels;
23         int err;
24  
25 -       mutex_lock(&chip->audio_mutex);
26 -
27         /* notify the vchiq that it should enter spdif passthrough mode by
28          * setting channels=0 (see
29          * https://github.com/raspberrypi/linux/issues/528)
30 @@ -233,7 +231,7 @@ static int snd_bcm2835_pcm_prepare(struc
31                                        runtime->rate,
32                                        snd_pcm_format_width(runtime->format));
33         if (err < 0)
34 -               goto out;
35 +               return err;
36  
37         memset(&alsa_stream->pcm_indirect, 0, sizeof(alsa_stream->pcm_indirect));
38  
39 @@ -246,9 +244,7 @@ static int snd_bcm2835_pcm_prepare(struc
40         alsa_stream->pos = 0;
41         alsa_stream->draining = false;
42  
43 - out:
44 -       mutex_unlock(&chip->audio_mutex);
45 -       return err;
46 +       return 0;
47  }
48  
49  static void snd_bcm2835_pcm_transfer(struct snd_pcm_substream *substream,