aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ns83820.c
diff options
context:
space:
mode:
authorDenis Kirjanov <dkirjanov@kernel.org>2010-08-30 17:19:15 -0400
committerDavid S. Miller <davem@davemloft.net>2010-09-01 13:57:54 -0400
commit1a9f28c8f94659a70f34f0f2ab12371c0745518d (patch)
tree8672ee908ffbbe6d4e88252da23a9a29c4b345f4 /drivers/net/ns83820.c
parent875168a9330d3aa6481ce62ce8fa77c7be0c75fb (diff)
ns83820: Use helper to disable chip interrupts
Use helper routine to disable chip interrupts. Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ns83820.c')
-rw-r--r--drivers/net/ns83820.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c
index 5a3488f76b38..447c2c43769a 100644
--- a/drivers/net/ns83820.c
+++ b/drivers/net/ns83820.c
@@ -1405,6 +1405,13 @@ static const struct ethtool_ops ops = {
1405 .get_link = ns83820_get_link 1405 .get_link = ns83820_get_link
1406}; 1406};
1407 1407
1408static inline void ns83820_disable_interrupts(struct ns83820 *dev)
1409{
1410 writel(0, dev->base + IMR);
1411 writel(0, dev->base + IER);
1412 readl(dev->base + IER);
1413}
1414
1408/* this function is called in irq context from the ISR */ 1415/* this function is called in irq context from the ISR */
1409static void ns83820_mib_isr(struct ns83820 *dev) 1416static void ns83820_mib_isr(struct ns83820 *dev)
1410{ 1417{
@@ -1557,10 +1564,7 @@ static int ns83820_stop(struct net_device *ndev)
1557 /* FIXME: protect against interrupt handler? */ 1564 /* FIXME: protect against interrupt handler? */
1558 del_timer_sync(&dev->tx_watchdog); 1565 del_timer_sync(&dev->tx_watchdog);
1559 1566
1560 /* disable interrupts */ 1567 ns83820_disable_interrupts(dev);
1561 writel(0, dev->base + IMR);
1562 writel(0, dev->base + IER);
1563 readl(dev->base + IER);
1564 1568
1565 dev->rx_info.up = 0; 1569 dev->rx_info.up = 0;
1566 synchronize_irq(dev->pci_dev->irq); 1570 synchronize_irq(dev->pci_dev->irq);
@@ -2023,10 +2027,7 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev,
2023 dev->tx_descs, (long)dev->tx_phy_descs, 2027 dev->tx_descs, (long)dev->tx_phy_descs,
2024 dev->rx_info.descs, (long)dev->rx_info.phy_descs); 2028 dev->rx_info.descs, (long)dev->rx_info.phy_descs);
2025 2029
2026 /* disable interrupts */ 2030 ns83820_disable_interrupts(dev);
2027 writel(0, dev->base + IMR);
2028 writel(0, dev->base + IER);
2029 readl(dev->base + IER);
2030 2031
2031 dev->IMR_cache = 0; 2032 dev->IMR_cache = 0;
2032 2033
@@ -2250,9 +2251,7 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev,
2250 return 0; 2251 return 0;
2251 2252
2252out_cleanup: 2253out_cleanup:
2253 writel(0, dev->base + IMR); /* paranoia */ 2254 ns83820_disable_interrupts(dev); /* paranoia */
2254 writel(0, dev->base + IER);
2255 readl(dev->base + IER);
2256out_free_irq: 2255out_free_irq:
2257 rtnl_unlock(); 2256 rtnl_unlock();
2258 free_irq(pci_dev->irq, ndev); 2257 free_irq(pci_dev->irq, ndev);
@@ -2277,9 +2276,7 @@ static void __devexit ns83820_remove_one(struct pci_dev *pci_dev)
2277 if (!ndev) /* paranoia */ 2276 if (!ndev) /* paranoia */
2278 return; 2277 return;
2279 2278
2280 writel(0, dev->base + IMR); /* paranoia */ 2279 ns83820_disable_interrupts(dev); /* paranoia */
2281 writel(0, dev->base + IER);
2282 readl(dev->base + IER);
2283 2280
2284 unregister_netdev(ndev); 2281 unregister_netdev(ndev);
2285 free_irq(dev->pci_dev->irq, ndev); 2282 free_irq(dev->pci_dev->irq, ndev);