aboutsummaryrefslogtreecommitdiff
path: root/sound/usb/usbaudio.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-01-16 16:36:05 +0100
committerJaroslav Kysela <perex@suse.cz>2006-03-22 10:25:43 +0100
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 @@
#include <linux/usb.h>
#include <linux/vmalloc.h>
#include <linux/moduleparam.h>
+#include <linux/mutex.h>
#include <sound/core.h>
#include <sound/info.h>
#include <sound/pcm.h>
@@ -202,7 +203,7 @@ struct snd_usb_stream {
* the all interfaces on the same card as one sound device.
*/
-static DECLARE_MUTEX(register_mutex);
+static DEFINE_MUTEX(register_mutex);
static struct snd_usb_audio *usb_chip[SNDRV_CARDS];
@@ -3285,7 +3286,7 @@ static void *snd_usb_audio_probe(struct usb_device *dev,
/* check whether it's already registered */
chip = NULL;
- down(&register_mutex);
+ mutex_lock(&register_mutex);
for (i = 0; i < SNDRV_CARDS; i++) {
if (usb_chip[i] && usb_chip[i]->dev == dev) {
if (usb_chip[i]->shutdown) {
@@ -3338,13 +3339,13 @@ static void *snd_usb_audio_probe(struct usb_device *dev,
usb_chip[chip->index] = chip;
chip->num_interfaces++;
- up(&register_mutex);
+ mutex_unlock(&register_mutex);
return chip;
__error:
if (chip && !chip->num_interfaces)
snd_card_free(chip->card);
- up(&register_mutex);
+ mutex_unlock(&register_mutex);
__err_val:
return NULL;
}
@@ -3364,7 +3365,7 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr)
chip = ptr;
card = chip->card;
- down(&register_mutex);
+ mutex_lock(&register_mutex);
chip->shutdown = 1;
chip->num_interfaces--;
if (chip->num_interfaces <= 0) {
@@ -3382,10 +3383,10 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr)
snd_usb_mixer_disconnect(p);
}
usb_chip[chip->index] = NULL;
- up(&register_mutex);
+ mutex_unlock(&register_mutex);
snd_card_free(card);
} else {
- up(&register_mutex);
+ mutex_unlock(&register_mutex);
}
}