summaryrefslogtreecommitdiffstats
path: root/sound/core/sound_oss.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-01-16 16:29:08 +0100
committerJaroslav Kysela <perex@suse.cz>2006-03-22 10:24:50 +0100
commit1a60d4c5a0c4028559585a74e48593b16e1ca9b2 (patch)
treef03f8dfcd554f8ebbb295522dc46dfe4d110a484 /sound/core/sound_oss.c
parentf0283f45a04d5cf31512e5e390a38504d97e7a97 (diff)
downloadop-kernel-dev-1a60d4c5a0c4028559585a74e48593b16e1ca9b2.zip
op-kernel-dev-1a60d4c5a0c4028559585a74e48593b16e1ca9b2.tar.gz
[ALSA] semaphore -> mutex (core part)
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/core/sound_oss.c')
-rw-r--r--sound/core/sound_oss.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/sound/core/sound_oss.c b/sound/core/sound_oss.c
index d0be32b..6b4a4bc 100644
--- a/sound/core/sound_oss.c
+++ b/sound/core/sound_oss.c
@@ -34,11 +34,12 @@
#include <sound/minors.h>
#include <sound/info.h>
#include <linux/sound.h>
+#include <linux/mutex.h>
#define SNDRV_OSS_MINORS 128
static struct snd_minor *snd_oss_minors[SNDRV_OSS_MINORS];
-static DECLARE_MUTEX(sound_oss_mutex);
+static DEFINE_MUTEX(sound_oss_mutex);
void *snd_lookup_oss_minor_data(unsigned int minor, int type)
{
@@ -47,13 +48,13 @@ void *snd_lookup_oss_minor_data(unsigned int minor, int type)
if (minor > ARRAY_SIZE(snd_oss_minors))
return NULL;
- down(&sound_oss_mutex);
+ mutex_lock(&sound_oss_mutex);
mreg = snd_oss_minors[minor];
if (mreg && mreg->type == type)
private_data = mreg->private_data;
else
private_data = NULL;
- up(&sound_oss_mutex);
+ mutex_unlock(&sound_oss_mutex);
return private_data;
}
@@ -117,7 +118,7 @@ int snd_register_oss_device(int type, struct snd_card *card, int dev,
preg->device = dev;
preg->f_ops = f_ops;
preg->private_data = private_data;
- down(&sound_oss_mutex);
+ mutex_lock(&sound_oss_mutex);
snd_oss_minors[minor] = preg;
minor_unit = SNDRV_MINOR_OSS_DEVICE(minor);
switch (minor_unit) {
@@ -143,7 +144,7 @@ int snd_register_oss_device(int type, struct snd_card *card, int dev,
goto __end;
snd_oss_minors[track2] = preg;
}
- up(&sound_oss_mutex);
+ mutex_unlock(&sound_oss_mutex);
return 0;
__end:
@@ -152,7 +153,7 @@ int snd_register_oss_device(int type, struct snd_card *card, int dev,
if (register1 >= 0)
unregister_sound_special(register1);
snd_oss_minors[minor] = NULL;
- up(&sound_oss_mutex);
+ mutex_unlock(&sound_oss_mutex);
kfree(preg);
return -EBUSY;
}
@@ -168,10 +169,10 @@ int snd_unregister_oss_device(int type, struct snd_card *card, int dev)
return 0;
if (minor < 0)
return minor;
- down(&sound_oss_mutex);
+ mutex_lock(&sound_oss_mutex);
mptr = snd_oss_minors[minor];
if (mptr == NULL) {
- up(&sound_oss_mutex);
+ mutex_unlock(&sound_oss_mutex);
return -ENOENT;
}
unregister_sound_special(minor);
@@ -191,7 +192,7 @@ int snd_unregister_oss_device(int type, struct snd_card *card, int dev)
snd_oss_minors[track2] = NULL;
}
snd_oss_minors[minor] = NULL;
- up(&sound_oss_mutex);
+ mutex_unlock(&sound_oss_mutex);
kfree(mptr);
return 0;
}
@@ -229,7 +230,7 @@ static void snd_minor_info_oss_read(struct snd_info_entry *entry,
int minor;
struct snd_minor *mptr;
- down(&sound_oss_mutex);
+ mutex_lock(&sound_oss_mutex);
for (minor = 0; minor < SNDRV_OSS_MINORS; ++minor) {
if (!(mptr = snd_oss_minors[minor]))
continue;
@@ -241,7 +242,7 @@ static void snd_minor_info_oss_read(struct snd_info_entry *entry,
snd_iprintf(buffer, "%3i: : %s\n", minor,
snd_oss_device_type_name(mptr->type));
}
- up(&sound_oss_mutex);
+ mutex_unlock(&sound_oss_mutex);
}
OpenPOWER on IntegriCloud