X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Fpci%2Fmixart%2Fmixart_core.c;h=07c707d7ebbfee43922ce0ce458a78d65c4899ff;hb=987b0145d94eecf292d8b301228356f44611ab7c;hp=406ac3a9d42ade4329ed16c6ef49f5e61f6a46d6;hpb=f7ed79d23a47594e7834d66a8f14449796d4f3e6;p=linux-2.6.git diff --git a/sound/pci/mixart/mixart_core.c b/sound/pci/mixart/mixart_core.c index 406ac3a9d..07c707d7e 100644 --- a/sound/pci/mixart/mixart_core.c +++ b/sound/pci/mixart/mixart_core.c @@ -22,8 +22,6 @@ #include #include -#include - #include #include #include "mixart.h" @@ -241,7 +239,7 @@ int snd_mixart_send_msg(struct mixart_mgr *mgr, struct mixart_msg *request, int wait_queue_t wait; long timeout; - mutex_lock(&mgr->msg_mutex); + down(&mgr->msg_mutex); init_waitqueue_entry(&wait, current); @@ -250,7 +248,7 @@ int snd_mixart_send_msg(struct mixart_mgr *mgr, struct mixart_msg *request, int err = send_msg(mgr, request, max_resp_size, 1, &msg_frame); /* send and mark the answer pending */ if (err) { spin_unlock_irq(&mgr->msg_lock); - mutex_unlock(&mgr->msg_mutex); + up(&mgr->msg_mutex); return err; } @@ -262,7 +260,7 @@ int snd_mixart_send_msg(struct mixart_mgr *mgr, struct mixart_msg *request, int if (! timeout) { /* error - no ack */ - mutex_unlock(&mgr->msg_mutex); + up(&mgr->msg_mutex); snd_printk(KERN_ERR "error: no reponse on msg %x\n", msg_frame); return -EIO; } @@ -278,7 +276,7 @@ int snd_mixart_send_msg(struct mixart_mgr *mgr, struct mixart_msg *request, int if( request->message_id != resp.message_id ) snd_printk(KERN_ERR "REPONSE ERROR!\n"); - mutex_unlock(&mgr->msg_mutex); + up(&mgr->msg_mutex); return err; } @@ -294,7 +292,7 @@ int snd_mixart_send_msg_wait_notif(struct mixart_mgr *mgr, snd_assert((notif_event & MSG_TYPE_MASK) == MSG_TYPE_NOTIFY, return -EINVAL); snd_assert((notif_event & MSG_CANCEL_NOTIFY_MASK) == 0, return -EINVAL); - mutex_lock(&mgr->msg_mutex); + down(&mgr->msg_mutex); init_waitqueue_entry(&wait, current); @@ -303,7 +301,7 @@ int snd_mixart_send_msg_wait_notif(struct mixart_mgr *mgr, err = send_msg(mgr, request, MSG_DEFAULT_SIZE, 1, ¬if_event); /* send and mark the notification event pending */ if(err) { spin_unlock_irq(&mgr->msg_lock); - mutex_unlock(&mgr->msg_mutex); + up(&mgr->msg_mutex); return err; } @@ -315,12 +313,12 @@ int snd_mixart_send_msg_wait_notif(struct mixart_mgr *mgr, if (! timeout) { /* error - no ack */ - mutex_unlock(&mgr->msg_mutex); + up(&mgr->msg_mutex); snd_printk(KERN_ERR "error: notification %x not received\n", notif_event); return -EIO; } - mutex_unlock(&mgr->msg_mutex); + up(&mgr->msg_mutex); return 0; }