]> err.no Git - linux-2.6/commitdiff
Prism54: Convert mgmt_sem to the mutex API
authorMatthias Kaehlcke <matthias.kaehlcke@gmail.com>
Mon, 5 Nov 2007 08:41:01 +0000 (09:41 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:03:32 +0000 (15:03 -0800)
Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/prism54/islpci_dev.c
drivers/net/wireless/prism54/islpci_dev.h
drivers/net/wireless/prism54/islpci_mgt.c

index 219dd651dc41067b4ecd66083b9d23a172ffd261..dbb538ccb4ecc295fa1a451fe00377816bd89297 100644 (file)
@@ -861,7 +861,7 @@ islpci_setup(struct pci_dev *pdev)
        init_waitqueue_head(&priv->reset_done);
 
        /* init the queue read locks, process wait counter */
-       sema_init(&priv->mgmt_sem, 1);
+       mutex_init(&priv->mgmt_lock);
        priv->mgmt_received = NULL;
        init_waitqueue_head(&priv->mgmt_wqueue);
        sema_init(&priv->stats_sem, 1);
index 736666da6c24344580c547ea708e3c24a65727f7..4e0182ce835bacecc067fcc871b859bb1f93e664 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/wireless.h>
 #include <net/iw_handler.h>
 #include <linux/list.h>
+#include <linux/mutex.h>
 
 #include "isl_38xx.h"
 #include "isl_oid.h"
@@ -164,7 +165,7 @@ typedef struct {
        wait_queue_head_t reset_done;
 
        /* used by islpci_mgt_transaction */
-       struct semaphore mgmt_sem; /* serialize access to mailbox and wqueue */
+       struct mutex mgmt_lock; /* serialize access to mailbox and wqueue */
        struct islpci_mgmtframe *mgmt_received;   /* mbox for incoming frame */
        wait_queue_head_t mgmt_wqueue;            /* waitqueue for mbox */
 
index 2246f7930b4edfd45aeac66a5bdf4c194ce91a96..f7c677e2094d168e53fe5ea890bdec5a6459b4b2 100644 (file)
@@ -460,7 +460,7 @@ islpci_mgt_transaction(struct net_device *ndev,
 
        *recvframe = NULL;
 
-       if (down_interruptible(&priv->mgmt_sem))
+       if (mutex_lock_interruptible(&priv->mgmt_lock))
                return -ERESTARTSYS;
 
        prepare_to_wait(&priv->mgmt_wqueue, &wait, TASK_UNINTERRUPTIBLE);
@@ -504,7 +504,7 @@ islpci_mgt_transaction(struct net_device *ndev,
        /* TODO: we should reset the device here */
  out:
        finish_wait(&priv->mgmt_wqueue, &wait);
-       up(&priv->mgmt_sem);
+       mutex_unlock(&priv->mgmt_lock);
        return err;
 }