summaryrefslogtreecommitdiff
path: root/sound/oss/emu10k1
diff options
context:
space:
mode:
Diffstat (limited to 'sound/oss/emu10k1')
-rw-r--r--sound/oss/emu10k1/hwaccess.h2
-rw-r--r--sound/oss/emu10k1/main.c2
-rw-r--r--sound/oss/emu10k1/midi.c14
3 files changed, 9 insertions, 9 deletions
diff --git a/sound/oss/emu10k1/hwaccess.h b/sound/oss/emu10k1/hwaccess.h
index 104223a192aa..85e27bda694b 100644
--- a/sound/oss/emu10k1/hwaccess.h
+++ b/sound/oss/emu10k1/hwaccess.h
@@ -181,7 +181,7 @@ struct emu10k1_card
struct emu10k1_mpuout *mpuout;
struct emu10k1_mpuin *mpuin;
- struct semaphore open_sem;
+ struct mutex open_sem;
mode_t open_mode;
wait_queue_head_t open_wait;
diff --git a/sound/oss/emu10k1/main.c b/sound/oss/emu10k1/main.c
index 23241cbdd90f..0cd44a6f7ac0 100644
--- a/sound/oss/emu10k1/main.c
+++ b/sound/oss/emu10k1/main.c
@@ -1320,7 +1320,7 @@ static int __devinit emu10k1_probe(struct pci_dev *pci_dev, const struct pci_dev
card->is_aps = (subsysvid == EMU_APS_SUBID);
spin_lock_init(&card->lock);
- init_MUTEX(&card->open_sem);
+ mutex_init(&card->open_sem);
card->open_mode = 0;
init_waitqueue_head(&card->open_wait);
diff --git a/sound/oss/emu10k1/midi.c b/sound/oss/emu10k1/midi.c
index b40b5f97aace..959a96794dba 100644
--- a/sound/oss/emu10k1/midi.c
+++ b/sound/oss/emu10k1/midi.c
@@ -110,21 +110,21 @@ match:
#endif
/* Wait for device to become free */
- down(&card->open_sem);
+ mutex_lock(&card->open_sem);
while (card->open_mode & (file->f_mode << FMODE_MIDI_SHIFT)) {
if (file->f_flags & O_NONBLOCK) {
- up(&card->open_sem);
+ mutex_unlock(&card->open_sem);
return -EBUSY;
}
- up(&card->open_sem);
+ mutex_unlock(&card->open_sem);
interruptible_sleep_on(&card->open_wait);
if (signal_pending(current)) {
return -ERESTARTSYS;
}
- down(&card->open_sem);
+ mutex_lock(&card->open_sem);
}
if ((midi_dev = (struct emu10k1_mididevice *) kmalloc(sizeof(*midi_dev), GFP_KERNEL)) == NULL)
@@ -183,7 +183,7 @@ match:
card->open_mode |= (file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ | FMODE_MIDI_WRITE);
- up(&card->open_sem);
+ mutex_unlock(&card->open_sem);
return nonseekable_open(inode, file);
}
@@ -234,9 +234,9 @@ static int emu10k1_midi_release(struct inode *inode, struct file *file)
kfree(midi_dev);
- down(&card->open_sem);
+ mutex_lock(&card->open_sem);
card->open_mode &= ~((file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ | FMODE_MIDI_WRITE));
- up(&card->open_sem);
+ mutex_unlock(&card->open_sem);
wake_up_interruptible(&card->open_wait);
unlock_kernel();