aboutsummaryrefslogtreecommitdiffstats
path: root/sound/oss/emu10k1/midi.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-03-23 06:00:47 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-23 10:38:15 -0500
commitf82945dff51ff7b33f69cb45a8342b936e966f7f (patch)
treed550c4b48fd13574147d09b49b1706fcf3644dc3 /sound/oss/emu10k1/midi.c
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/midi.c')
-rw-r--r--sound/oss/emu10k1/midi.c14
1 files changed, 7 insertions, 7 deletions
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:
110#endif 110#endif
111 111
112 /* Wait for device to become free */ 112 /* Wait for device to become free */
113 down(&card->open_sem); 113 mutex_lock(&card->open_sem);
114 while (card->open_mode & (file->f_mode << FMODE_MIDI_SHIFT)) { 114 while (card->open_mode & (file->f_mode << FMODE_MIDI_SHIFT)) {
115 if (file->f_flags & O_NONBLOCK) { 115 if (file->f_flags & O_NONBLOCK) {
116 up(&card->open_sem); 116 mutex_unlock(&card->open_sem);
117 return -EBUSY; 117 return -EBUSY;
118 } 118 }
119 119
120 up(&card->open_sem); 120 mutex_unlock(&card->open_sem);
121 interruptible_sleep_on(&card->open_wait); 121 interruptible_sleep_on(&card->open_wait);
122 122
123 if (signal_pending(current)) { 123 if (signal_pending(current)) {
124 return -ERESTARTSYS; 124 return -ERESTARTSYS;
125 } 125 }
126 126
127 down(&card->open_sem); 127 mutex_lock(&card->open_sem);
128 } 128 }
129 129
130 if ((midi_dev = (struct emu10k1_mididevice *) kmalloc(sizeof(*midi_dev), GFP_KERNEL)) == NULL) 130 if ((midi_dev = (struct emu10k1_mididevice *) kmalloc(sizeof(*midi_dev), GFP_KERNEL)) == NULL)
@@ -183,7 +183,7 @@ match:
183 183
184 card->open_mode |= (file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ | FMODE_MIDI_WRITE); 184 card->open_mode |= (file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ | FMODE_MIDI_WRITE);
185 185
186 up(&card->open_sem); 186 mutex_unlock(&card->open_sem);
187 187
188 return nonseekable_open(inode, file); 188 return nonseekable_open(inode, file);
189} 189}
@@ -234,9 +234,9 @@ static int emu10k1_midi_release(struct inode *inode, struct file *file)
234 234
235 kfree(midi_dev); 235 kfree(midi_dev);
236 236
237 down(&card->open_sem); 237 mutex_lock(&card->open_sem);
238 card->open_mode &= ~((file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ | FMODE_MIDI_WRITE)); 238 card->open_mode &= ~((file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ | FMODE_MIDI_WRITE));
239 up(&card->open_sem); 239 mutex_unlock(&card->open_sem);
240 wake_up_interruptible(&card->open_wait); 240 wake_up_interruptible(&card->open_wait);
241 241
242 unlock_kernel(); 242 unlock_kernel();