From: Matthias Kaehlcke Date: Fri, 14 Dec 2007 00:03:00 +0000 (-0800) Subject: PLIP driver: convert the semaphore killed_timer_sem to completion X-Git-Tag: v2.6.25-rc1~1162^2~335 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01f31ac8289200e1cab4d100ce991cebe5731360;p=linux-2.6 PLIP driver: convert the semaphore killed_timer_sem to completion Signed-off-by: Matthias Kaehlcke Cc: Jeff Garzik Signed-off-by: Andrew Morton Signed-off-by: Jeff Garzik --- diff --git a/drivers/net/plip.c b/drivers/net/plip.c index 57c9866998..fee3d7b1fe 100644 --- a/drivers/net/plip.c +++ b/drivers/net/plip.c @@ -106,6 +106,7 @@ static const char version[] = "NET3 PLIP version 2.4-parport gniibe@mri.co.jp\n" #include #include #include +#include #include #include @@ -114,7 +115,6 @@ static const char version[] = "NET3 PLIP version 2.4-parport gniibe@mri.co.jp\n" #include #include #include -#include /* Maximum number of devices to support. */ #define PLIP_MAX 8 @@ -221,7 +221,7 @@ struct net_local { int should_relinquish; spinlock_t lock; atomic_t kill_timer; - struct semaphore killed_timer_sem; + struct completion killed_timer_cmp; }; static inline void enable_parport_interrupts (struct net_device *dev) @@ -385,7 +385,7 @@ plip_timer_bh(struct work_struct *work) schedule_delayed_work(&nl->timer, 1); } else { - up (&nl->killed_timer_sem); + complete(&nl->killed_timer_cmp); } } @@ -1112,9 +1112,9 @@ plip_close(struct net_device *dev) if (dev->irq == -1) { - init_MUTEX_LOCKED (&nl->killed_timer_sem); + init_completion(&nl->killed_timer_cmp); atomic_set (&nl->kill_timer, 1); - down (&nl->killed_timer_sem); + wait_for_completion(&nl->killed_timer_cmp); } #ifdef NOTDEF