diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-03-23 12:00:39 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-23 16:38:13 +0100 |
commit | 910f5d202ce39cc78de1bbb679285a3167de9fb2 (patch) | |
tree | 2c5b55c2b141aaf016c459beb397fc702c41b967 /sound/oss/forte.c | |
parent | [PATCH] sem2mutex: drivers/block/nbd.c (diff) | |
download | linux-910f5d202ce39cc78de1bbb679285a3167de9fb2.tar.xz linux-910f5d202ce39cc78de1bbb679285a3167de9fb2.zip |
[PATCH] sem2mutex: sound/oss/
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: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'sound/oss/forte.c')
-rw-r--r-- | sound/oss/forte.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sound/oss/forte.c b/sound/oss/forte.c index 8406bc90c4ff..0294eec8ad90 100644 --- a/sound/oss/forte.c +++ b/sound/oss/forte.c @@ -43,6 +43,7 @@ #include <linux/interrupt.h> #include <linux/proc_fs.h> +#include <linux/mutex.h> #include <asm/uaccess.h> #include <asm/io.h> @@ -185,7 +186,7 @@ struct forte_chip { unsigned long iobase; int irq; - struct semaphore open_sem; /* Device access */ + struct mutex open_mutex; /* Device access */ spinlock_t lock; /* State */ spinlock_t ac97_lock; @@ -1242,13 +1243,13 @@ forte_dsp_open (struct inode *inode, struct file *file) struct forte_chip *chip = forte; /* FIXME: HACK FROM HELL! */ if (file->f_flags & O_NONBLOCK) { - if (down_trylock (&chip->open_sem)) { + if (!mutex_trylock(&chip->open_mutex)) { DPRINTK ("%s: returning -EAGAIN\n", __FUNCTION__); return -EAGAIN; } } else { - if (down_interruptible (&chip->open_sem)) { + if (mutex_lock_interruptible(&chip->open_mutex)) { DPRINTK ("%s: returning -ERESTARTSYS\n", __FUNCTION__); return -ERESTARTSYS; } @@ -1302,7 +1303,7 @@ forte_dsp_release (struct inode *inode, struct file *file) spin_unlock_irq (&chip->lock); } - up (&chip->open_sem); + mutex_unlock(&chip->open_mutex); return ret; } @@ -2011,7 +2012,7 @@ forte_probe (struct pci_dev *pci_dev, const struct pci_device_id *pci_id) memset (chip, 0, sizeof (struct forte_chip)); chip->pci_dev = pci_dev; - init_MUTEX(&chip->open_sem); + mutex_init(&chip->open_mutex); spin_lock_init (&chip->lock); spin_lock_init (&chip->ac97_lock); |