Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
[pandora-kernel.git] / drivers / net / plip.c
index 57c9866..1e96542 100644 (file)
@@ -106,6 +106,7 @@ static const char version[] = "NET3 PLIP version 2.4-parport gniibe@mri.co.jp\n"
 #include <linux/if_plip.h>
 #include <linux/workqueue.h>
 #include <linux/spinlock.h>
+#include <linux/completion.h>
 #include <linux/parport.h>
 #include <linux/bitops.h>
 
@@ -114,7 +115,6 @@ static const char version[] = "NET3 PLIP version 2.4-parport gniibe@mri.co.jp\n"
 #include <asm/system.h>
 #include <asm/irq.h>
 #include <asm/byteorder.h>
-#include <asm/semaphore.h>
 
 /* 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