Skip to content

Commit

Permalink
WARNING: some request_irq() failures ignored in el2_open()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
roel kluin authored and David S. Miller committed Sep 3, 2009
1 parent aa13307 commit ab08999
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions drivers/net/3c503.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,15 +383,16 @@ el2_probe1(struct net_device *dev, int ioaddr)
static int
el2_open(struct net_device *dev)
{
int retval = -EAGAIN;
int retval;

if (dev->irq < 2) {
int irqlist[] = {5, 9, 3, 4, 0};
int *irqp = irqlist;

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);
Expand All @@ -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))) {
Expand Down

0 comments on commit ab08999

Please sign in to comment.