aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/usbaudio.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-01-16 10:36:05 -0500
committerJaroslav Kysela <perex@suse.cz>2006-03-22 04:25:43 -0500
commit12aa757905d09b1dc2c1c3d0de3fa8f4c9726f2b (patch)
treec776b2b66618915502cb8c552fe6fc720a18306d /sound/usb/usbaudio.c
parent62932df8fb20ba2fb53a95fa52445eba22e821fe (diff)
[ALSA] semaphore -> mutex (Archs, misc buses)
Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/usbaudio.c')
-rw-r--r--sound/usb/usbaudio.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index c9476c237c4..53009bb642f 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -47,6 +47,7 @@
47#include <linux/usb.h> 47#include <linux/usb.h>
48#include <linux/vmalloc.h> 48#include <linux/vmalloc.h>
49#include <linux/moduleparam.h> 49#include <linux/moduleparam.h>
50#include <linux/mutex.h>
50#include <sound/core.h> 51#include <sound/core.h>
51#include <sound/info.h> 52#include <sound/info.h>
52#include <sound/pcm.h> 53#include <sound/pcm.h>
@@ -202,7 +203,7 @@ struct snd_usb_stream {
202 * the all interfaces on the same card as one sound device. 203 * the all interfaces on the same card as one sound device.
203 */ 204 */
204 205
205static DECLARE_MUTEX(register_mutex); 206static DEFINE_MUTEX(register_mutex);
206static struct snd_usb_audio *usb_chip[SNDRV_CARDS]; 207static struct snd_usb_audio *usb_chip[SNDRV_CARDS];
207 208
208 209
@@ -3285,7 +3286,7 @@ static void *snd_usb_audio_probe(struct usb_device *dev,
3285 3286
3286 /* check whether it's already registered */ 3287 /* check whether it's already registered */
3287 chip = NULL; 3288 chip = NULL;
3288 down(&register_mutex); 3289 mutex_lock(&register_mutex);
3289 for (i = 0; i < SNDRV_CARDS; i++) { 3290 for (i = 0; i < SNDRV_CARDS; i++) {
3290 if (usb_chip[i] && usb_chip[i]->dev == dev) { 3291 if (usb_chip[i] && usb_chip[i]->dev == dev) {
3291 if (usb_chip[i]->shutdown) { 3292 if (usb_chip[i]->shutdown) {
@@ -3338,13 +3339,13 @@ static void *snd_usb_audio_probe(struct usb_device *dev,
3338 3339
3339 usb_chip[chip->index] = chip; 3340 usb_chip[chip->index] = chip;
3340 chip->num_interfaces++; 3341 chip->num_interfaces++;
3341 up(&register_mutex); 3342 mutex_unlock(&register_mutex);
3342 return chip; 3343 return chip;
3343 3344
3344 __error: 3345 __error:
3345 if (chip && !chip->num_interfaces) 3346 if (chip && !chip->num_interfaces)
3346 snd_card_free(chip->card); 3347 snd_card_free(chip->card);
3347 up(&register_mutex); 3348 mutex_unlock(&register_mutex);
3348 __err_val: 3349 __err_val:
3349 return NULL; 3350 return NULL;
3350} 3351}
@@ -3364,7 +3365,7 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr)
3364 3365
3365 chip = ptr; 3366 chip = ptr;
3366 card = chip->card; 3367 card = chip->card;
3367 down(&register_mutex); 3368 mutex_lock(&register_mutex);
3368 chip->shutdown = 1; 3369 chip->shutdown = 1;
3369 chip->num_interfaces--; 3370 chip->num_interfaces--;
3370 if (chip->num_interfaces <= 0) { 3371 if (chip->num_interfaces <= 0) {
@@ -3382,10 +3383,10 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr)
3382 snd_usb_mixer_disconnect(p); 3383 snd_usb_mixer_disconnect(p);
3383 } 3384 }
3384 usb_chip[chip->index] = NULL; 3385 usb_chip[chip->index] = NULL;
3385 up(&register_mutex); 3386 mutex_unlock(&register_mutex);
3386 snd_card_free(card); 3387 snd_card_free(card);
3387 } else { 3388 } else {
3388 up(&register_mutex); 3389 mutex_unlock(&register_mutex);
3389 } 3390 }
3390} 3391}
3391 3392