WARNING: some request_irq() failures ignored in el2_open()
authorroel kluin <roel.kluin@gmail.com>
Tue, 1 Sep 2009 06:24:53 +0000 (06:24 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Sep 2009 06:45:54 +0000 (23:45 -0700)
Request_irq() may fail in different ways, handle accordingly.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/3c503.c

index 134638a9759fabbdc9f06150fce3d9d5a2523904..81c148a59adf351f989d7b5c379b15cb9ee706b0 100644 (file)
@@ -383,7 +383,7 @@ out:
 static int
 el2_open(struct net_device *dev)
 {
-    int retval = -EAGAIN;
+    int retval;
 
     if (dev->irq < 2) {
        int irqlist[] = {5, 9, 3, 4, 0};
@@ -391,7 +391,8 @@ el2_open(struct net_device *dev)
 
        outb(EGACFR_NORM, E33G_GACFR);  /* Enable RAM and interrupts. */
        do {
-           if (request_irq (*irqp, NULL, 0, "bogus", dev) != -EBUSY) {
+           retval = request_irq(*irqp, NULL, 0, "bogus", dev);
+           if (retval >= 0) {
                /* Twinkle the interrupt, and check if it's seen. */
                unsigned long cookie = probe_irq_on();
                outb_p(0x04 << ((*irqp == 9) ? 2 : *irqp), E33G_IDCFR);
@@ -400,11 +401,14 @@ el2_open(struct net_device *dev)
                    && ((retval = request_irq(dev->irq = *irqp,
                    eip_interrupt, 0, dev->name, dev)) == 0))
                    break;
+           } else {
+                   if (retval != -EBUSY)
+                           return reval;
            }
        } while (*++irqp);
        if (*irqp == 0) {
            outb(EGACFR_IRQOFF, E33G_GACFR);    /* disable interrupts. */
-           return retval;
+           return -EAGAIN;
        }
     } else {
        if ((retval = request_irq(dev->irq, eip_interrupt, 0, dev->name, dev))) {