staging: bcm2835-audio: Clean up mutex locks
authorTakashi Iwai <tiwai@suse.de>
Tue, 4 Sep 2018 15:58:30 +0000 (17:58 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Sep 2018 09:14:58 +0000 (11:14 +0200)
commitda85d3b1a8d4a9f70d4d48b7629f3f215ef9ec40
tree8d6cc3247ecca8f94fe784dc5d17bdde3c23ce83
parent7e33f3850c53e10704990f21a160705474f72f43
staging: bcm2835-audio: Clean up mutex locks

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