From 1a60d4c5a0c4028559585a74e48593b16e1ca9b2 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Mon, 16 Jan 2006 16:29:08 +0100 Subject: [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 Signed-off-by: Andrew Morton Signed-off-by: Takashi Iwai --- sound/core/seq/oss/seq_oss.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'sound/core/seq/oss') diff --git a/sound/core/seq/oss/seq_oss.c b/sound/core/seq/oss/seq_oss.c index c98f0ba13810..b9919785180b 100644 --- a/sound/core/seq/oss/seq_oss.c +++ b/sound/core/seq/oss/seq_oss.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -124,7 +125,7 @@ module_exit(alsa_seq_oss_exit) * ALSA minor device interface */ -static DECLARE_MUTEX(register_mutex); +static DEFINE_MUTEX(register_mutex); static int odev_open(struct inode *inode, struct file *file) @@ -136,9 +137,9 @@ odev_open(struct inode *inode, struct file *file) else level = SNDRV_SEQ_OSS_MODE_SYNTH; - down(®ister_mutex); + mutex_lock(®ister_mutex); rc = snd_seq_oss_open(file, level); - up(®ister_mutex); + mutex_unlock(®ister_mutex); return rc; } @@ -153,9 +154,9 @@ odev_release(struct inode *inode, struct file *file) snd_seq_oss_drain_write(dp); - down(®ister_mutex); + mutex_lock(®ister_mutex); snd_seq_oss_release(dp); - up(®ister_mutex); + mutex_unlock(®ister_mutex); return 0; } @@ -224,13 +225,13 @@ register_device(void) { int rc; - down(®ister_mutex); + mutex_lock(®ister_mutex); if ((rc = snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_SEQUENCER, NULL, 0, &seq_oss_f_ops, NULL, SNDRV_SEQ_OSS_DEVNAME)) < 0) { snd_printk(KERN_ERR "can't register device seq\n"); - up(®ister_mutex); + mutex_unlock(®ister_mutex); return rc; } if ((rc = snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_MUSIC, @@ -239,24 +240,24 @@ register_device(void) SNDRV_SEQ_OSS_DEVNAME)) < 0) { snd_printk(KERN_ERR "can't register device music\n"); snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_SEQUENCER, NULL, 0); - up(®ister_mutex); + mutex_unlock(®ister_mutex); return rc; } debug_printk(("device registered\n")); - up(®ister_mutex); + mutex_unlock(®ister_mutex); return 0; } static void unregister_device(void) { - down(®ister_mutex); + mutex_lock(®ister_mutex); debug_printk(("device unregistered\n")); if (snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_MUSIC, NULL, 0) < 0) snd_printk(KERN_ERR "error unregister device music\n"); if (snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_SEQUENCER, NULL, 0) < 0) snd_printk(KERN_ERR "error unregister device seq\n"); - up(®ister_mutex); + mutex_unlock(®ister_mutex); } /* @@ -270,12 +271,12 @@ static struct snd_info_entry *info_entry; static void info_read(struct snd_info_entry *entry, struct snd_info_buffer *buf) { - down(®ister_mutex); + mutex_lock(®ister_mutex); snd_iprintf(buf, "OSS sequencer emulation version %s\n", SNDRV_SEQ_OSS_VERSION_STR); snd_seq_oss_system_info_read(buf); snd_seq_oss_synth_info_read(buf); snd_seq_oss_midi_info_read(buf); - up(®ister_mutex); + mutex_unlock(®ister_mutex); } -- cgit