diff options
Diffstat (limited to 'sound/pci/mixart/mixart_core.c')
-rw-r--r-- | sound/pci/mixart/mixart_core.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sound/pci/mixart/mixart_core.c b/sound/pci/mixart/mixart_core.c index 07c707d7ebbf..406ac3a9d42a 100644 --- a/sound/pci/mixart/mixart_core.c +++ b/sound/pci/mixart/mixart_core.c | |||
@@ -22,6 +22,8 @@ | |||
22 | 22 | ||
23 | #include <sound/driver.h> | 23 | #include <sound/driver.h> |
24 | #include <linux/interrupt.h> | 24 | #include <linux/interrupt.h> |
25 | #include <linux/mutex.h> | ||
26 | |||
25 | #include <asm/io.h> | 27 | #include <asm/io.h> |
26 | #include <sound/core.h> | 28 | #include <sound/core.h> |
27 | #include "mixart.h" | 29 | #include "mixart.h" |
@@ -239,7 +241,7 @@ int snd_mixart_send_msg(struct mixart_mgr *mgr, struct mixart_msg *request, int | |||
239 | wait_queue_t wait; | 241 | wait_queue_t wait; |
240 | long timeout; | 242 | long timeout; |
241 | 243 | ||
242 | down(&mgr->msg_mutex); | 244 | mutex_lock(&mgr->msg_mutex); |
243 | 245 | ||
244 | init_waitqueue_entry(&wait, current); | 246 | init_waitqueue_entry(&wait, current); |
245 | 247 | ||
@@ -248,7 +250,7 @@ int snd_mixart_send_msg(struct mixart_mgr *mgr, struct mixart_msg *request, int | |||
248 | err = send_msg(mgr, request, max_resp_size, 1, &msg_frame); /* send and mark the answer pending */ | 250 | err = send_msg(mgr, request, max_resp_size, 1, &msg_frame); /* send and mark the answer pending */ |
249 | if (err) { | 251 | if (err) { |
250 | spin_unlock_irq(&mgr->msg_lock); | 252 | spin_unlock_irq(&mgr->msg_lock); |
251 | up(&mgr->msg_mutex); | 253 | mutex_unlock(&mgr->msg_mutex); |
252 | return err; | 254 | return err; |
253 | } | 255 | } |
254 | 256 | ||
@@ -260,7 +262,7 @@ int snd_mixart_send_msg(struct mixart_mgr *mgr, struct mixart_msg *request, int | |||
260 | 262 | ||
261 | if (! timeout) { | 263 | if (! timeout) { |
262 | /* error - no ack */ | 264 | /* error - no ack */ |
263 | up(&mgr->msg_mutex); | 265 | mutex_unlock(&mgr->msg_mutex); |
264 | snd_printk(KERN_ERR "error: no reponse on msg %x\n", msg_frame); | 266 | snd_printk(KERN_ERR "error: no reponse on msg %x\n", msg_frame); |
265 | return -EIO; | 267 | return -EIO; |
266 | } | 268 | } |
@@ -276,7 +278,7 @@ int snd_mixart_send_msg(struct mixart_mgr *mgr, struct mixart_msg *request, int | |||
276 | if( request->message_id != resp.message_id ) | 278 | if( request->message_id != resp.message_id ) |
277 | snd_printk(KERN_ERR "REPONSE ERROR!\n"); | 279 | snd_printk(KERN_ERR "REPONSE ERROR!\n"); |
278 | 280 | ||
279 | up(&mgr->msg_mutex); | 281 | mutex_unlock(&mgr->msg_mutex); |
280 | return err; | 282 | return err; |
281 | } | 283 | } |
282 | 284 | ||
@@ -292,7 +294,7 @@ int snd_mixart_send_msg_wait_notif(struct mixart_mgr *mgr, | |||
292 | snd_assert((notif_event & MSG_TYPE_MASK) == MSG_TYPE_NOTIFY, return -EINVAL); | 294 | snd_assert((notif_event & MSG_TYPE_MASK) == MSG_TYPE_NOTIFY, return -EINVAL); |
293 | snd_assert((notif_event & MSG_CANCEL_NOTIFY_MASK) == 0, return -EINVAL); | 295 | snd_assert((notif_event & MSG_CANCEL_NOTIFY_MASK) == 0, return -EINVAL); |
294 | 296 | ||
295 | down(&mgr->msg_mutex); | 297 | mutex_lock(&mgr->msg_mutex); |
296 | 298 | ||
297 | init_waitqueue_entry(&wait, current); | 299 | init_waitqueue_entry(&wait, current); |
298 | 300 | ||
@@ -301,7 +303,7 @@ int snd_mixart_send_msg_wait_notif(struct mixart_mgr *mgr, | |||
301 | err = send_msg(mgr, request, MSG_DEFAULT_SIZE, 1, ¬if_event); /* send and mark the notification event pending */ | 303 | err = send_msg(mgr, request, MSG_DEFAULT_SIZE, 1, ¬if_event); /* send and mark the notification event pending */ |
302 | if(err) { | 304 | if(err) { |
303 | spin_unlock_irq(&mgr->msg_lock); | 305 | spin_unlock_irq(&mgr->msg_lock); |
304 | up(&mgr->msg_mutex); | 306 | mutex_unlock(&mgr->msg_mutex); |
305 | return err; | 307 | return err; |
306 | } | 308 | } |
307 | 309 | ||
@@ -313,12 +315,12 @@ int snd_mixart_send_msg_wait_notif(struct mixart_mgr *mgr, | |||
313 | 315 | ||
314 | if (! timeout) { | 316 | if (! timeout) { |
315 | /* error - no ack */ | 317 | /* error - no ack */ |
316 | up(&mgr->msg_mutex); | 318 | mutex_unlock(&mgr->msg_mutex); |
317 | snd_printk(KERN_ERR "error: notification %x not received\n", notif_event); | 319 | snd_printk(KERN_ERR "error: notification %x not received\n", notif_event); |
318 | return -EIO; | 320 | return -EIO; |
319 | } | 321 | } |
320 | 322 | ||
321 | up(&mgr->msg_mutex); | 323 | mutex_unlock(&mgr->msg_mutex); |
322 | return 0; | 324 | return 0; |
323 | } | 325 | } |
324 | 326 | ||