aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/dec
diff options
context:
space:
mode:
authorFrancois Romieu <romieu@fr.zoreil.com>2012-03-09 09:15:03 -0500
committerFrancois Romieu <romieu@fr.zoreil.com>2012-04-07 05:47:16 -0400
commit308f2888a3ff442167e2aea419225445b7a1b8b6 (patch)
tree9452c0afd9927fd68cb7910867330f24ce698196 /drivers/net/ethernet/dec
parentebaf7f8f78e8600b56010121766ed832f2f57b0f (diff)
de2104x: stop using net_device.{base_addr, irq}.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Acked-by: Grant Grundler <grundler@parisc-linux.org>
Diffstat (limited to 'drivers/net/ethernet/dec')
-rw-r--r--drivers/net/ethernet/dec/tulip/de2104x.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/drivers/net/ethernet/dec/tulip/de2104x.c b/drivers/net/ethernet/dec/tulip/de2104x.c
index 68f1c39184df..61cc09342865 100644
--- a/drivers/net/ethernet/dec/tulip/de2104x.c
+++ b/drivers/net/ethernet/dec/tulip/de2104x.c
@@ -1380,6 +1380,7 @@ static void de_free_rings (struct de_private *de)
1380static int de_open (struct net_device *dev) 1380static int de_open (struct net_device *dev)
1381{ 1381{
1382 struct de_private *de = netdev_priv(dev); 1382 struct de_private *de = netdev_priv(dev);
1383 const int irq = de->pdev->irq;
1383 int rc; 1384 int rc;
1384 1385
1385 netif_dbg(de, ifup, dev, "enabling interface\n"); 1386 netif_dbg(de, ifup, dev, "enabling interface\n");
@@ -1394,10 +1395,9 @@ static int de_open (struct net_device *dev)
1394 1395
1395 dw32(IntrMask, 0); 1396 dw32(IntrMask, 0);
1396 1397
1397 rc = request_irq(dev->irq, de_interrupt, IRQF_SHARED, dev->name, dev); 1398 rc = request_irq(irq, de_interrupt, IRQF_SHARED, dev->name, dev);
1398 if (rc) { 1399 if (rc) {
1399 netdev_err(dev, "IRQ %d request failure, err=%d\n", 1400 netdev_err(dev, "IRQ %d request failure, err=%d\n", irq, rc);
1400 dev->irq, rc);
1401 goto err_out_free; 1401 goto err_out_free;
1402 } 1402 }
1403 1403
@@ -1413,7 +1413,7 @@ static int de_open (struct net_device *dev)
1413 return 0; 1413 return 0;
1414 1414
1415err_out_free_irq: 1415err_out_free_irq:
1416 free_irq(dev->irq, dev); 1416 free_irq(irq, dev);
1417err_out_free: 1417err_out_free:
1418 de_free_rings(de); 1418 de_free_rings(de);
1419 return rc; 1419 return rc;
@@ -1434,7 +1434,7 @@ static int de_close (struct net_device *dev)
1434 netif_carrier_off(dev); 1434 netif_carrier_off(dev);
1435 spin_unlock_irqrestore(&de->lock, flags); 1435 spin_unlock_irqrestore(&de->lock, flags);
1436 1436
1437 free_irq(dev->irq, dev); 1437 free_irq(de->pdev->irq, dev);
1438 1438
1439 de_free_rings(de); 1439 de_free_rings(de);
1440 de_adapter_sleep(de); 1440 de_adapter_sleep(de);
@@ -1444,6 +1444,7 @@ static int de_close (struct net_device *dev)
1444static void de_tx_timeout (struct net_device *dev) 1444static void de_tx_timeout (struct net_device *dev)
1445{ 1445{
1446 struct de_private *de = netdev_priv(dev); 1446 struct de_private *de = netdev_priv(dev);
1447 const int irq = de->pdev->irq;
1447 1448
1448 netdev_dbg(dev, "NIC status %08x mode %08x sia %08x desc %u/%u/%u\n", 1449 netdev_dbg(dev, "NIC status %08x mode %08x sia %08x desc %u/%u/%u\n",
1449 dr32(MacStatus), dr32(MacMode), dr32(SIAStatus), 1450 dr32(MacStatus), dr32(MacMode), dr32(SIAStatus),
@@ -1451,7 +1452,7 @@ static void de_tx_timeout (struct net_device *dev)
1451 1452
1452 del_timer_sync(&de->media_timer); 1453 del_timer_sync(&de->media_timer);
1453 1454
1454 disable_irq(dev->irq); 1455 disable_irq(irq);
1455 spin_lock_irq(&de->lock); 1456 spin_lock_irq(&de->lock);
1456 1457
1457 de_stop_hw(de); 1458 de_stop_hw(de);
@@ -1459,12 +1460,12 @@ static void de_tx_timeout (struct net_device *dev)
1459 netif_carrier_off(dev); 1460 netif_carrier_off(dev);
1460 1461
1461 spin_unlock_irq(&de->lock); 1462 spin_unlock_irq(&de->lock);
1462 enable_irq(dev->irq); 1463 enable_irq(irq);
1463 1464
1464 /* Update the error counts. */ 1465 /* Update the error counts. */
1465 __de_get_stats(de); 1466 __de_get_stats(de);
1466 1467
1467 synchronize_irq(dev->irq); 1468 synchronize_irq(irq);
1468 de_clean_rings(de); 1469 de_clean_rings(de);
1469 1470
1470 de_init_rings(de); 1471 de_init_rings(de);
@@ -2024,8 +2025,6 @@ static int __devinit de_init_one (struct pci_dev *pdev,
2024 goto err_out_res; 2025 goto err_out_res;
2025 } 2026 }
2026 2027
2027 dev->irq = pdev->irq;
2028
2029 /* obtain and check validity of PCI I/O address */ 2028 /* obtain and check validity of PCI I/O address */
2030 pciaddr = pci_resource_start(pdev, 1); 2029 pciaddr = pci_resource_start(pdev, 1);
2031 if (!pciaddr) { 2030 if (!pciaddr) {
@@ -2050,7 +2049,6 @@ static int __devinit de_init_one (struct pci_dev *pdev,
2050 pciaddr, pci_name(pdev)); 2049 pciaddr, pci_name(pdev));
2051 goto err_out_res; 2050 goto err_out_res;
2052 } 2051 }
2053 dev->base_addr = (unsigned long) regs;
2054 de->regs = regs; 2052 de->regs = regs;
2055 2053
2056 de_adapter_wake(de); 2054 de_adapter_wake(de);
@@ -2078,11 +2076,9 @@ static int __devinit de_init_one (struct pci_dev *pdev,
2078 goto err_out_iomap; 2076 goto err_out_iomap;
2079 2077
2080 /* print info about board and interface just registered */ 2078 /* print info about board and interface just registered */
2081 netdev_info(dev, "%s at 0x%lx, %pM, IRQ %d\n", 2079 netdev_info(dev, "%s at %p, %pM, IRQ %d\n",
2082 de->de21040 ? "21040" : "21041", 2080 de->de21040 ? "21040" : "21041",
2083 dev->base_addr, 2081 regs, dev->dev_addr, pdev->irq);
2084 dev->dev_addr,
2085 dev->irq);
2086 2082
2087 pci_set_drvdata(pdev, dev); 2083 pci_set_drvdata(pdev, dev);
2088 2084
@@ -2130,9 +2126,11 @@ static int de_suspend (struct pci_dev *pdev, pm_message_t state)
2130 2126
2131 rtnl_lock(); 2127 rtnl_lock();
2132 if (netif_running (dev)) { 2128 if (netif_running (dev)) {
2129 const int irq = pdev->irq;
2130
2133 del_timer_sync(&de->media_timer); 2131 del_timer_sync(&de->media_timer);
2134 2132
2135 disable_irq(dev->irq); 2133 disable_irq(irq);
2136 spin_lock_irq(&de->lock); 2134 spin_lock_irq(&de->lock);
2137 2135
2138 de_stop_hw(de); 2136 de_stop_hw(de);
@@ -2141,12 +2139,12 @@ static int de_suspend (struct pci_dev *pdev, pm_message_t state)
2141 netif_carrier_off(dev); 2139 netif_carrier_off(dev);
2142 2140
2143 spin_unlock_irq(&de->lock); 2141 spin_unlock_irq(&de->lock);
2144 enable_irq(dev->irq); 2142 enable_irq(irq);
2145 2143
2146 /* Update the error counts. */ 2144 /* Update the error counts. */
2147 __de_get_stats(de); 2145 __de_get_stats(de);
2148 2146
2149 synchronize_irq(dev->irq); 2147 synchronize_irq(irq);
2150 de_clean_rings(de); 2148 de_clean_rings(de);
2151 2149
2152 de_adapter_sleep(de); 2150 de_adapter_sleep(de);