summaryrefslogtreecommitdiff
path: root/drivers/net/b44.c
diff options
context:
space:
mode:
authorFrancois Romieu <romieu@fr.zoreil.com>2005-11-07 01:52:57 +0100
committerJeff Garzik <jgarzik@pobox.com>2005-11-07 03:37:05 -0500
commit6c2f4267833f453156f8f439cc32eb4c92f357b4 (patch)
tree912f0075a855d652a58a9bb8cd9f3ca9a98fd745 /drivers/net/b44.c
parent65b984f26f16e97168ee29e53145055412f38a23 (diff)
[PATCH] b44: late request_irq in b44_open
Don't request_irq before the registers are reset/init. Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/b44.c')
-rw-r--r--drivers/net/b44.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index 09e1b4deae59..ecc2e32c38c1 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -1388,13 +1388,7 @@ static int b44_open(struct net_device *dev)
err = b44_alloc_consistent(bp);
if (err)
- return err;
-
- err = request_irq(dev->irq, b44_interrupt, SA_SHIRQ, dev->name, dev);
- if (err)
- goto err_out_free;
-
- spin_lock_irq(&bp->lock);
+ goto out;
b44_init_rings(bp);
b44_init_hw(bp);
@@ -1403,7 +1397,13 @@ static int b44_open(struct net_device *dev)
netif_carrier_off(dev);
b44_check_phy(bp);
- spin_unlock_irq(&bp->lock);
+ err = request_irq(dev->irq, b44_interrupt, SA_SHIRQ, dev->name, dev);
+ if (unlikely(err < 0)) {
+ b44_chip_reset(bp);
+ b44_free_rings(bp);
+ b44_free_consistent(bp);
+ goto out;
+ }
init_timer(&bp->timer);
bp->timer.expires = jiffies + HZ;
@@ -1412,11 +1412,7 @@ static int b44_open(struct net_device *dev)
add_timer(&bp->timer);
b44_enable_ints(bp);
-
- return 0;
-
-err_out_free:
- b44_free_consistent(bp);
+out:
return err;
}