summaryrefslogtreecommitdiffstats
path: root/sound/oss/forte.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/oss/forte.c')
-rw-r--r--sound/oss/forte.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sound/oss/forte.c b/sound/oss/forte.c
index 8406bc90c4f..0294eec8ad9 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);