aboutsummaryrefslogtreecommitdiffstats
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 8406bc90c4ff..0294eec8ad90 100644
--- a/sound/oss/forte.c
+++ b/sound/oss/forte.c
@@ -43,6 +43,7 @@
43#include <linux/interrupt.h> 43#include <linux/interrupt.h>
44 44
45#include <linux/proc_fs.h> 45#include <linux/proc_fs.h>
46#include <linux/mutex.h>
46 47
47#include <asm/uaccess.h> 48#include <asm/uaccess.h>
48#include <asm/io.h> 49#include <asm/io.h>
@@ -185,7 +186,7 @@ struct forte_chip {
185 unsigned long iobase; 186 unsigned long iobase;
186 int irq; 187 int irq;
187 188
188 struct semaphore open_sem; /* Device access */ 189 struct mutex open_mutex; /* Device access */
189 spinlock_t lock; /* State */ 190 spinlock_t lock; /* State */
190 191
191 spinlock_t ac97_lock; 192 spinlock_t ac97_lock;
@@ -1242,13 +1243,13 @@ forte_dsp_open (struct inode *inode, struct file *file)
1242 struct forte_chip *chip = forte; /* FIXME: HACK FROM HELL! */ 1243 struct forte_chip *chip = forte; /* FIXME: HACK FROM HELL! */
1243 1244
1244 if (file->f_flags & O_NONBLOCK) { 1245 if (file->f_flags & O_NONBLOCK) {
1245 if (down_trylock (&chip->open_sem)) { 1246 if (!mutex_trylock(&chip->open_mutex)) {
1246 DPRINTK ("%s: returning -EAGAIN\n", __FUNCTION__); 1247 DPRINTK ("%s: returning -EAGAIN\n", __FUNCTION__);
1247 return -EAGAIN; 1248 return -EAGAIN;
1248 } 1249 }
1249 } 1250 }
1250 else { 1251 else {
1251 if (down_interruptible (&chip->open_sem)) { 1252 if (mutex_lock_interruptible(&chip->open_mutex)) {
1252 DPRINTK ("%s: returning -ERESTARTSYS\n", __FUNCTION__); 1253 DPRINTK ("%s: returning -ERESTARTSYS\n", __FUNCTION__);
1253 return -ERESTARTSYS; 1254 return -ERESTARTSYS;
1254 } 1255 }
@@ -1302,7 +1303,7 @@ forte_dsp_release (struct inode *inode, struct file *file)
1302 spin_unlock_irq (&chip->lock); 1303 spin_unlock_irq (&chip->lock);
1303 } 1304 }
1304 1305
1305 up (&chip->open_sem); 1306 mutex_unlock(&chip->open_mutex);
1306 1307
1307 return ret; 1308 return ret;
1308} 1309}
@@ -2011,7 +2012,7 @@ forte_probe (struct pci_dev *pci_dev, const struct pci_device_id *pci_id)
2011 memset (chip, 0, sizeof (struct forte_chip)); 2012 memset (chip, 0, sizeof (struct forte_chip));
2012 chip->pci_dev = pci_dev; 2013 chip->pci_dev = pci_dev;
2013 2014
2014 init_MUTEX(&chip->open_sem); 2015 mutex_init(&chip->open_mutex);
2015 spin_lock_init (&chip->lock); 2016 spin_lock_init (&chip->lock);
2016 spin_lock_init (&chip->ac97_lock); 2017 spin_lock_init (&chip->ac97_lock);
2017 2018