summaryrefslogtreecommitdiffstats
path: root/sound/pci/nm256/nm256.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/nm256/nm256.c')
-rw-r--r--sound/pci/nm256/nm256.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c
index 0d0ff54f0fc..3a3ba6f547b 100644
--- a/sound/pci/nm256/nm256.c
+++ b/sound/pci/nm256/nm256.c
@@ -32,6 +32,8 @@
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/moduleparam.h>
+#include <linux/mutex.h>
+
#include <sound/core.h>
#include <sound/info.h>
#include <sound/control.h>
@@ -235,7 +237,7 @@ struct nm256 {
int irq_acks;
irqreturn_t (*interrupt)(int, void *, struct pt_regs *);
int badintrcount; /* counter to check bogus interrupts */
- struct semaphore irq_mutex;
+ struct mutex irq_mutex;
struct nm256_stream streams[2];
@@ -459,32 +461,32 @@ snd_nm256_set_format(struct nm256 *chip, struct nm256_stream *s,
/* acquire interrupt */
static int snd_nm256_acquire_irq(struct nm256 *chip)
{
- down(&chip->irq_mutex);
+ mutex_lock(&chip->irq_mutex);
if (chip->irq < 0) {
if (request_irq(chip->pci->irq, chip->interrupt, SA_INTERRUPT|SA_SHIRQ,
chip->card->driver, chip)) {
snd_printk(KERN_ERR "unable to grab IRQ %d\n", chip->pci->irq);
- up(&chip->irq_mutex);
+ mutex_unlock(&chip->irq_mutex);
return -EBUSY;
}
chip->irq = chip->pci->irq;
}
chip->irq_acks++;
- up(&chip->irq_mutex);
+ mutex_unlock(&chip->irq_mutex);
return 0;
}
/* release interrupt */
static void snd_nm256_release_irq(struct nm256 *chip)
{
- down(&chip->irq_mutex);
+ mutex_lock(&chip->irq_mutex);
if (chip->irq_acks > 0)
chip->irq_acks--;
if (chip->irq_acks == 0 && chip->irq >= 0) {
free_irq(chip->irq, chip);
chip->irq = -1;
}
- up(&chip->irq_mutex);
+ mutex_unlock(&chip->irq_mutex);
}
/*
@@ -1407,7 +1409,7 @@ snd_nm256_create(struct snd_card *card, struct pci_dev *pci,
chip->use_cache = use_cache;
spin_lock_init(&chip->reg_lock);
chip->irq = -1;
- init_MUTEX(&chip->irq_mutex);
+ mutex_init(&chip->irq_mutex);
/* store buffer sizes in bytes */
chip->streams[SNDRV_PCM_STREAM_PLAYBACK].bufsize = playback_bufsize * 1024;