Commit f622360b authored by Daniel Walker's avatar Daniel Walker Committed by John W. Linville

ps3: gelic: updown_lock semaphore to mutex

Signed-off-by: default avatarDaniel Walker <dwalker@mvista.com>
Acked-by: default avatarMasakazu Mokuno <mokuno@sm.sony.co.jp>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent bb2d67a3
...@@ -110,7 +110,7 @@ static void gelic_card_get_ether_port_status(struct gelic_card *card, ...@@ -110,7 +110,7 @@ static void gelic_card_get_ether_port_status(struct gelic_card *card,
void gelic_card_up(struct gelic_card *card) void gelic_card_up(struct gelic_card *card)
{ {
pr_debug("%s: called\n", __func__); pr_debug("%s: called\n", __func__);
down(&card->updown_lock); mutex_lock(&card->updown_lock);
if (atomic_inc_return(&card->users) == 1) { if (atomic_inc_return(&card->users) == 1) {
pr_debug("%s: real do\n", __func__); pr_debug("%s: real do\n", __func__);
/* enable irq */ /* enable irq */
...@@ -120,7 +120,7 @@ void gelic_card_up(struct gelic_card *card) ...@@ -120,7 +120,7 @@ void gelic_card_up(struct gelic_card *card)
napi_enable(&card->napi); napi_enable(&card->napi);
} }
up(&card->updown_lock); mutex_unlock(&card->updown_lock);
pr_debug("%s: done\n", __func__); pr_debug("%s: done\n", __func__);
} }
...@@ -128,7 +128,7 @@ void gelic_card_down(struct gelic_card *card) ...@@ -128,7 +128,7 @@ void gelic_card_down(struct gelic_card *card)
{ {
u64 mask; u64 mask;
pr_debug("%s: called\n", __func__); pr_debug("%s: called\n", __func__);
down(&card->updown_lock); mutex_lock(&card->updown_lock);
if (atomic_dec_if_positive(&card->users) == 0) { if (atomic_dec_if_positive(&card->users) == 0) {
pr_debug("%s: real do\n", __func__); pr_debug("%s: real do\n", __func__);
napi_disable(&card->napi); napi_disable(&card->napi);
...@@ -146,7 +146,7 @@ void gelic_card_down(struct gelic_card *card) ...@@ -146,7 +146,7 @@ void gelic_card_down(struct gelic_card *card)
/* stop tx */ /* stop tx */
gelic_card_disable_txdmac(card); gelic_card_disable_txdmac(card);
} }
up(&card->updown_lock); mutex_unlock(&card->updown_lock);
pr_debug("%s: done\n", __func__); pr_debug("%s: done\n", __func__);
} }
...@@ -1534,7 +1534,7 @@ static struct gelic_card *gelic_alloc_card_net(struct net_device **netdev) ...@@ -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_WORK(&card->tx_timeout_task, gelic_net_tx_timeout_task);
init_waitqueue_head(&card->waitq); init_waitqueue_head(&card->waitq);
atomic_set(&card->tx_timeout_task_counter, 0); atomic_set(&card->tx_timeout_task_counter, 0);
init_MUTEX(&card->updown_lock); mutex_init(&card->updown_lock);
atomic_set(&card->users, 0); atomic_set(&card->users, 0);
return card; return card;
......
...@@ -298,7 +298,7 @@ struct gelic_card { ...@@ -298,7 +298,7 @@ struct gelic_card {
wait_queue_head_t waitq; wait_queue_head_t waitq;
/* only first user should up the card */ /* only first user should up the card */
struct semaphore updown_lock; struct mutex updown_lock;
atomic_t users; atomic_t users;
u64 ether_port_status; u64 ether_port_status;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment