Skip to content

Commit

Permalink
ps3: gelic: updown_lock semaphore to mutex
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Walker <dwalker@mvista.com>
Acked-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Daniel Walker authored and John W. Linville committed Jun 3, 2008
1 parent bb2d67a commit f622360
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions drivers/net/ps3_gelic_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -120,15 +120,15 @@ 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__);
}

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);
Expand All @@ -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__);
}

Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ps3_gelic_net.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f622360

Please sign in to comment.