]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ps3: gelic: updown_lock semaphore to mutex
authorDaniel Walker <dwalker@mvista.com>
Thu, 22 May 2008 07:00:03 +0000 (00:00 -0700)
committerJeff Garzik <jgarzik@redhat.com>
Sat, 31 May 2008 02:18:37 +0000 (22:18 -0400)
Signed-off-by: Daniel Walker <dwalker@mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/net/ps3_gelic_net.c
drivers/net/ps3_gelic_net.h

index e365efb3c6275c6af7d7fc4fa9688e95a953b86c..2eb54fd7bed532153f4aafef049a97f5459caa02 100644 (file)
@@ -110,7 +110,7 @@ static void gelic_card_get_ether_port_status(struct gelic_card *card,
 void gelic_card_up(struct gelic_card *card)
 {
        pr_debug("%s: called\n", __func__);
-       down(&card->updown_lock);
+       mutex_lock(&card->updown_lock);
        if (atomic_inc_return(&card->users) == 1) {
                pr_debug("%s: real do\n", __func__);
                /* enable irq */
@@ -120,7 +120,7 @@ void gelic_card_up(struct gelic_card *card)
 
                napi_enable(&card->napi);
        }
-       up(&card->updown_lock);
+       mutex_unlock(&card->updown_lock);
        pr_debug("%s: done\n", __func__);
 }
 
@@ -128,7 +128,7 @@ void gelic_card_down(struct gelic_card *card)
 {
        u64 mask;
        pr_debug("%s: called\n", __func__);
-       down(&card->updown_lock);
+       mutex_lock(&card->updown_lock);
        if (atomic_dec_if_positive(&card->users) == 0) {
                pr_debug("%s: real do\n", __func__);
                napi_disable(&card->napi);
@@ -146,7 +146,7 @@ void gelic_card_down(struct gelic_card *card)
                /* stop tx */
                gelic_card_disable_txdmac(card);
        }
-       up(&card->updown_lock);
+       mutex_unlock(&card->updown_lock);
        pr_debug("%s: done\n", __func__);
 }
 
@@ -1534,7 +1534,7 @@ static struct gelic_card *gelic_alloc_card_net(struct net_device **netdev)
        INIT_WORK(&card->tx_timeout_task, gelic_net_tx_timeout_task);
        init_waitqueue_head(&card->waitq);
        atomic_set(&card->tx_timeout_task_counter, 0);
-       init_MUTEX(&card->updown_lock);
+       mutex_init(&card->updown_lock);
        atomic_set(&card->users, 0);
 
        return card;
index 520f143c2c09c39cde27ed7ee83275a211c60abe..8b413868bbe2a1b180b6295b9ab4e26f90251023 100644 (file)
@@ -298,7 +298,7 @@ struct gelic_card {
        wait_queue_head_t waitq;
 
        /* only first user should up the card */
-       struct semaphore updown_lock;
+       struct mutex updown_lock;
        atomic_t users;
 
        u64 ether_port_status;