summaryrefslogtreecommitdiffstats
path: root/sound/oss/emu10k1
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-03-23 03:00:47 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-23 07:38:15 -0800
commitf82945dff51ff7b33f69cb45a8342b936e966f7f (patch)
treed550c4b48fd13574147d09b49b1706fcf3644dc3 /sound/oss/emu10k1
parent6389a385114ae358693f213266de6468ea116c77 (diff)
[PATCH] oss: semaphore to mutex conversion
Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Extracted for OSS/Free changes from Ingo's original patches. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
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 104223a192a..85e27bda694 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 23241cbdd90..0cd44a6f7ac 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 b40b5f97aac..959a96794db 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();