staging: bcm2835-audio: Clean up mutex locks
authorTakashi Iwai <tiwai@suse.de>
Tue, 4 Sep 2018 15:58:30 +0000 (17:58 +0200)
committerpopcornmix <popcornmix@gmail.com>
Mon, 13 May 2019 23:08:29 +0000 (00:08 +0100)
commitbd2855573c333041c9ba7a94b378504c82e8e916
treeed12f8c941590f9b7e8a34c9fbb996ab9c9be81b
parentede222d35f812245e29967c37754421bddcd44e5
staging: bcm2835-audio: Clean up mutex locks

commit ce4bb1aa271a97047b80ac917a5d91b54925913b upstream.

snd-bcm2835 driver takes the lock with mutex_lock_interruptible() in
all places, which don't make sense.  Replace them with the simple
mutex_lock().

Also taking a mutex lock right after creating it for each PCM object
is nonsense, too.  It cannot be racy at that point.  We can get rid of
it.

Last but not least, initializing chip->audio_mutex at each place is
error-prone.  Initialize properly at creating the chip object in
snd_bcm2835_create() instead.

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-ctl.c
drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
drivers/staging/vc04_services/bcm2835-audio/bcm2835.c