X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fnet%2Fplip.c;h=1e965427b0e987faae6ae26bfe3d07e1aad8bfa7;hb=fb3b27bc00ca2b6d69c3a22ff43b4d95fef47bed;hp=57c98669984db34dbc921216e7256a0dec8e8f40;hpb=1265edb8fd2869d17128f1d60683dd6f4191d550;p=linux-2.6-omap-h63xx.git diff --git a/drivers/net/plip.c b/drivers/net/plip.c index 57c98669984..1e965427b0e 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); } } @@ -903,17 +903,18 @@ plip_interrupt(void *dev_id) struct net_local *nl; struct plip_local *rcv; unsigned char c0; + unsigned long flags; nl = netdev_priv(dev); rcv = &nl->rcv_data; - spin_lock_irq (&nl->lock); + spin_lock_irqsave (&nl->lock, flags); c0 = read_status(dev); if ((c0 & 0xf8) != 0xc0) { if ((dev->irq != -1) && (net_debug > 1)) printk(KERN_DEBUG "%s: spurious interrupt\n", dev->name); - spin_unlock_irq (&nl->lock); + spin_unlock_irqrestore (&nl->lock, flags); return; } @@ -942,7 +943,7 @@ plip_interrupt(void *dev_id) break; } - spin_unlock_irq(&nl->lock); + spin_unlock_irqrestore(&nl->lock, flags); } static int @@ -1112,9 +1113,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