diff options
Diffstat (limited to 'sound/oss/emu10k1')
-rw-r--r-- | sound/oss/emu10k1/hwaccess.h | 2 | ||||
-rw-r--r-- | sound/oss/emu10k1/main.c | 2 | ||||
-rw-r--r-- | sound/oss/emu10k1/midi.c | 14 |
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 | |||
181 | struct emu10k1_mpuout *mpuout; | 181 | struct emu10k1_mpuout *mpuout; |
182 | struct emu10k1_mpuin *mpuin; | 182 | struct emu10k1_mpuin *mpuin; |
183 | 183 | ||
184 | struct semaphore open_sem; | 184 | struct mutex open_sem; |
185 | mode_t open_mode; | 185 | mode_t open_mode; |
186 | wait_queue_head_t open_wait; | 186 | wait_queue_head_t open_wait; |
187 | 187 | ||
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 | |||
1320 | card->is_aps = (subsysvid == EMU_APS_SUBID); | 1320 | card->is_aps = (subsysvid == EMU_APS_SUBID); |
1321 | 1321 | ||
1322 | spin_lock_init(&card->lock); | 1322 | spin_lock_init(&card->lock); |
1323 | init_MUTEX(&card->open_sem); | 1323 | mutex_init(&card->open_sem); |
1324 | card->open_mode = 0; | 1324 | card->open_mode = 0; |
1325 | init_waitqueue_head(&card->open_wait); | 1325 | init_waitqueue_head(&card->open_wait); |
1326 | 1326 | ||
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(); |