X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Fcore%2Fsound_oss.c;h=79752205c5c6b77028cce363c225ab7c3a2aea2d;hb=987b0145d94eecf292d8b301228356f44611ab7c;hp=9055c6de95875d4b199dce59b0db0b1fe5737ed6;hpb=f7ed79d23a47594e7834d66a8f14449796d4f3e6;p=linux-2.6.git diff --git a/sound/core/sound_oss.c b/sound/core/sound_oss.c index 9055c6de9..79752205c 100644 --- a/sound/core/sound_oss.c +++ b/sound/core/sound_oss.c @@ -34,12 +34,11 @@ #include #include #include -#include #define SNDRV_OSS_MINORS 128 static struct snd_minor *snd_oss_minors[SNDRV_OSS_MINORS]; -static DEFINE_MUTEX(sound_oss_mutex); +static DECLARE_MUTEX(sound_oss_mutex); void *snd_lookup_oss_minor_data(unsigned int minor, int type) { @@ -48,13 +47,13 @@ void *snd_lookup_oss_minor_data(unsigned int minor, int type) if (minor >= ARRAY_SIZE(snd_oss_minors)) return NULL; - mutex_lock(&sound_oss_mutex); + down(&sound_oss_mutex); mreg = snd_oss_minors[minor]; if (mreg && mreg->type == type) private_data = mreg->private_data; else private_data = NULL; - mutex_unlock(&sound_oss_mutex); + up(&sound_oss_mutex); return private_data; } @@ -95,7 +94,7 @@ static int snd_oss_kernel_minor(int type, struct snd_card *card, int dev) } int snd_register_oss_device(int type, struct snd_card *card, int dev, - const struct file_operations *f_ops, void *private_data, + struct file_operations *f_ops, void *private_data, const char *name) { int minor = snd_oss_kernel_minor(type, card, dev); @@ -118,7 +117,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; - mutex_lock(&sound_oss_mutex); + down(&sound_oss_mutex); snd_oss_minors[minor] = preg; minor_unit = SNDRV_MINOR_OSS_DEVICE(minor); switch (minor_unit) { @@ -144,7 +143,7 @@ int snd_register_oss_device(int type, struct snd_card *card, int dev, goto __end; snd_oss_minors[track2] = preg; } - mutex_unlock(&sound_oss_mutex); + up(&sound_oss_mutex); return 0; __end: @@ -153,7 +152,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; - mutex_unlock(&sound_oss_mutex); + up(&sound_oss_mutex); kfree(preg); return -EBUSY; } @@ -169,10 +168,10 @@ int snd_unregister_oss_device(int type, struct snd_card *card, int dev) return 0; if (minor < 0) return minor; - mutex_lock(&sound_oss_mutex); + down(&sound_oss_mutex); mptr = snd_oss_minors[minor]; if (mptr == NULL) { - mutex_unlock(&sound_oss_mutex); + up(&sound_oss_mutex); return -ENOENT; } unregister_sound_special(minor); @@ -192,7 +191,7 @@ int snd_unregister_oss_device(int type, struct snd_card *card, int dev) snd_oss_minors[track2] = NULL; } snd_oss_minors[minor] = NULL; - mutex_unlock(&sound_oss_mutex); + up(&sound_oss_mutex); kfree(mptr); return 0; } @@ -230,7 +229,7 @@ static void snd_minor_info_oss_read(struct snd_info_entry *entry, int minor; struct snd_minor *mptr; - mutex_lock(&sound_oss_mutex); + down(&sound_oss_mutex); for (minor = 0; minor < SNDRV_OSS_MINORS; ++minor) { if (!(mptr = snd_oss_minors[minor])) continue; @@ -242,7 +241,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)); } - mutex_unlock(&sound_oss_mutex); + up(&sound_oss_mutex); }