[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>
This commit is contained in:

committed by
Linus Torvalds

parent
6389a38511
commit
f82945dff5
@@ -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();
|
||||
|
Reference in New Issue
Block a user