diff options
author | Francois Romieu <romieu@fr.zoreil.com> | 2006-03-08 22:41:15 +0100 |
---|---|---|
committer | Romieu Francois <romieu@crap.fr.zoreil.com> | 2006-03-09 23:09:43 +0100 |
commit | 3f735b76a4e654bee652cbbeb405b9b3ef950316 (patch) | |
tree | c351f9674d8136a37a2c270e311e7bd17d3d0eb8 | |
parent | 6218cf4410cfce7bc7e89834e73525b124625d4c (diff) |
de2104x: prevent interrupt before the interrupt handler is registered
de_init_hw enables the irq thus it must be issued after request_irq.
Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
-rw-r--r-- | drivers/net/tulip/de2104x.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c index d7fb3ffe06ac..9e9e1fe92914 100644 --- a/drivers/net/tulip/de2104x.c +++ b/drivers/net/tulip/de2104x.c @@ -1362,7 +1362,6 @@ static int de_open (struct net_device *dev) { struct de_private *de = dev->priv; int rc; - unsigned long flags; if (netif_msg_ifup(de)) printk(KERN_DEBUG "%s: enabling interface\n", dev->name); @@ -1376,18 +1375,20 @@ static int de_open (struct net_device *dev) return rc; } - rc = de_init_hw(de); - if (rc) { - printk(KERN_ERR "%s: h/w init failure, err=%d\n", - dev->name, rc); - goto err_out_free; - } + dw32(IntrMask, 0); rc = request_irq(dev->irq, de_interrupt, SA_SHIRQ, dev->name, dev); if (rc) { printk(KERN_ERR "%s: IRQ %d request failure, err=%d\n", dev->name, dev->irq, rc); - goto err_out_hw; + goto err_out_free; + } + + rc = de_init_hw(de); + if (rc) { + printk(KERN_ERR "%s: h/w init failure, err=%d\n", + dev->name, rc); + goto err_out_free_irq; } netif_start_queue(dev); @@ -1395,11 +1396,8 @@ static int de_open (struct net_device *dev) return 0; -err_out_hw: - spin_lock_irqsave(&de->lock, flags); - de_stop_hw(de); - spin_unlock_irqrestore(&de->lock, flags); - +err_out_free_irq: + free_irq(dev->irq, dev); err_out_free: de_free_rings(de); return rc; |