Commit 8e27628e authored by Matthias Brugger's avatar Matthias Brugger Committed by David S. Miller

smsc911x.c: encapsulate enable irq calls

We encapsulate enbale irq functionality in a function call.
As on probe the interrupts will be disabled twice, we delete
one.
Signed-off-by: default avatarMatthias Brugger <mbrugger@iseebcn.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bb1dfefd
...@@ -1442,6 +1442,14 @@ smsc911x_set_hw_mac_address(struct smsc911x_data *pdata, u8 dev_addr[6]) ...@@ -1442,6 +1442,14 @@ smsc911x_set_hw_mac_address(struct smsc911x_data *pdata, u8 dev_addr[6])
smsc911x_mac_write(pdata, ADDRL, mac_low32); smsc911x_mac_write(pdata, ADDRL, mac_low32);
} }
static void smsc911x_disable_irq_chip(struct net_device *dev)
{
struct smsc911x_data *pdata = netdev_priv(dev);
smsc911x_reg_write(pdata, INT_EN, 0);
smsc911x_reg_write(pdata, INT_STS, 0xFFFFFFFF);
}
static int smsc911x_open(struct net_device *dev) static int smsc911x_open(struct net_device *dev)
{ {
struct smsc911x_data *pdata = netdev_priv(dev); struct smsc911x_data *pdata = netdev_priv(dev);
...@@ -1494,8 +1502,7 @@ static int smsc911x_open(struct net_device *dev) ...@@ -1494,8 +1502,7 @@ static int smsc911x_open(struct net_device *dev)
spin_unlock_irq(&pdata->mac_lock); spin_unlock_irq(&pdata->mac_lock);
/* Initialise irqs, but leave all sources disabled */ /* Initialise irqs, but leave all sources disabled */
smsc911x_reg_write(pdata, INT_EN, 0); smsc911x_disable_irq_chip(dev);
smsc911x_reg_write(pdata, INT_STS, 0xFFFFFFFF);
/* Set interrupt deassertion to 100uS */ /* Set interrupt deassertion to 100uS */
intcfg = ((10 << 24) | INT_CFG_IRQ_EN_); intcfg = ((10 << 24) | INT_CFG_IRQ_EN_);
...@@ -2215,9 +2222,6 @@ static int __devinit smsc911x_init(struct net_device *dev) ...@@ -2215,9 +2222,6 @@ static int __devinit smsc911x_init(struct net_device *dev)
if (smsc911x_soft_reset(pdata)) if (smsc911x_soft_reset(pdata))
return -ENODEV; return -ENODEV;
/* Disable all interrupt sources until we bring the device up */
smsc911x_reg_write(pdata, INT_EN, 0);
ether_setup(dev); ether_setup(dev);
dev->flags |= IFF_MULTICAST; dev->flags |= IFF_MULTICAST;
netif_napi_add(dev, &pdata->napi, smsc911x_poll, SMSC_NAPI_WEIGHT); netif_napi_add(dev, &pdata->napi, smsc911x_poll, SMSC_NAPI_WEIGHT);
...@@ -2434,8 +2438,7 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev) ...@@ -2434,8 +2438,7 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
smsc911x_reg_write(pdata, INT_CFG, intcfg); smsc911x_reg_write(pdata, INT_CFG, intcfg);
/* Ensure interrupts are globally disabled before connecting ISR */ /* Ensure interrupts are globally disabled before connecting ISR */
smsc911x_reg_write(pdata, INT_EN, 0); smsc911x_disable_irq_chip(dev);
smsc911x_reg_write(pdata, INT_STS, 0xFFFFFFFF);
retval = request_irq(dev->irq, smsc911x_irqhandler, retval = request_irq(dev->irq, smsc911x_irqhandler,
irq_flags | IRQF_SHARED, dev->name, dev); irq_flags | IRQF_SHARED, dev->name, dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment