aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/silan/sc92031.c
diff options
context:
space:
mode:
authorFrancois Romieu <romieu@fr.zoreil.com>2012-03-09 05:54:52 -0500
committerFrancois Romieu <romieu@fr.zoreil.com>2012-04-07 05:45:27 -0400
commitc4a9f0854bbea281f3d332c8c2b2b65a67b11616 (patch)
tree1f54b3eb19748d0b0e8c72992f5357f561b5838a /drivers/net/ethernet/silan/sc92031.c
parentc0bd55efd7b7ea8346ec3b5ce8414f978fede1f5 (diff)
sc92031: stop using net_device.{base_addr, irq}
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Diffstat (limited to 'drivers/net/ethernet/silan/sc92031.c')
-rw-r--r--drivers/net/ethernet/silan/sc92031.c34
1 files changed, 11 insertions, 23 deletions
diff --git a/drivers/net/ethernet/silan/sc92031.c b/drivers/net/ethernet/silan/sc92031.c
index a284d6440538..32e55664df6e 100644
--- a/drivers/net/ethernet/silan/sc92031.c
+++ b/drivers/net/ethernet/silan/sc92031.c
@@ -39,9 +39,7 @@
39#define SC92031_NAME "sc92031" 39#define SC92031_NAME "sc92031"
40 40
41/* BAR 0 is MMIO, BAR 1 is PIO */ 41/* BAR 0 is MMIO, BAR 1 is PIO */
42#ifndef SC92031_USE_BAR 42#define SC92031_USE_PIO 0
43#define SC92031_USE_BAR 0
44#endif
45 43
46/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). */ 44/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). */
47static int multicast_filter_limit = 64; 45static int multicast_filter_limit = 64;
@@ -366,7 +364,7 @@ static void sc92031_disable_interrupts(struct net_device *dev)
366 mmiowb(); 364 mmiowb();
367 365
368 /* wait for any concurrent interrupt/tasklet to finish */ 366 /* wait for any concurrent interrupt/tasklet to finish */
369 synchronize_irq(dev->irq); 367 synchronize_irq(priv->pdev->irq);
370 tasklet_disable(&priv->tasklet); 368 tasklet_disable(&priv->tasklet);
371} 369}
372 370
@@ -1114,10 +1112,13 @@ static void sc92031_tx_timeout(struct net_device *dev)
1114#ifdef CONFIG_NET_POLL_CONTROLLER 1112#ifdef CONFIG_NET_POLL_CONTROLLER
1115static void sc92031_poll_controller(struct net_device *dev) 1113static void sc92031_poll_controller(struct net_device *dev)
1116{ 1114{
1117 disable_irq(dev->irq); 1115 struct sc92031_priv *priv = netdev_priv(dev);
1118 if (sc92031_interrupt(dev->irq, dev) != IRQ_NONE) 1116 const int irq = priv->pdev->irq;
1117
1118 disable_irq(irq);
1119 if (sc92031_interrupt(irq, dev) != IRQ_NONE)
1119 sc92031_tasklet((unsigned long)dev); 1120 sc92031_tasklet((unsigned long)dev);
1120 enable_irq(dev->irq); 1121 enable_irq(irq);
1121} 1122}
1122#endif 1123#endif
1123 1124
@@ -1402,7 +1403,6 @@ static int __devinit sc92031_probe(struct pci_dev *pdev,
1402 struct net_device *dev; 1403 struct net_device *dev;
1403 struct sc92031_priv *priv; 1404 struct sc92031_priv *priv;
1404 u32 mac0, mac1; 1405 u32 mac0, mac1;
1405 unsigned long base_addr;
1406 1406
1407 err = pci_enable_device(pdev); 1407 err = pci_enable_device(pdev);
1408 if (unlikely(err < 0)) 1408 if (unlikely(err < 0))
@@ -1422,7 +1422,7 @@ static int __devinit sc92031_probe(struct pci_dev *pdev,
1422 if (unlikely(err < 0)) 1422 if (unlikely(err < 0))
1423 goto out_request_regions; 1423 goto out_request_regions;
1424 1424
1425 port_base = pci_iomap(pdev, SC92031_USE_BAR, 0); 1425 port_base = pci_iomap(pdev, SC92031_USE_PIO, 0);
1426 if (unlikely(!port_base)) { 1426 if (unlikely(!port_base)) {
1427 err = -EIO; 1427 err = -EIO;
1428 goto out_iomap; 1428 goto out_iomap;
@@ -1437,14 +1437,6 @@ static int __devinit sc92031_probe(struct pci_dev *pdev,
1437 pci_set_drvdata(pdev, dev); 1437 pci_set_drvdata(pdev, dev);
1438 SET_NETDEV_DEV(dev, &pdev->dev); 1438 SET_NETDEV_DEV(dev, &pdev->dev);
1439 1439
1440#if SC92031_USE_BAR == 0
1441 dev->mem_start = pci_resource_start(pdev, SC92031_USE_BAR);
1442 dev->mem_end = pci_resource_end(pdev, SC92031_USE_BAR);
1443#elif SC92031_USE_BAR == 1
1444 dev->base_addr = pci_resource_start(pdev, SC92031_USE_BAR);
1445#endif
1446 dev->irq = pdev->irq;
1447
1448 /* faked with skb_copy_and_csum_dev */ 1440 /* faked with skb_copy_and_csum_dev */
1449 dev->features = NETIF_F_SG | NETIF_F_HIGHDMA | 1441 dev->features = NETIF_F_SG | NETIF_F_HIGHDMA |
1450 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; 1442 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
@@ -1478,13 +1470,9 @@ static int __devinit sc92031_probe(struct pci_dev *pdev,
1478 if (err < 0) 1470 if (err < 0)
1479 goto out_register_netdev; 1471 goto out_register_netdev;
1480 1472
1481#if SC92031_USE_BAR == 0
1482 base_addr = dev->mem_start;
1483#elif SC92031_USE_BAR == 1
1484 base_addr = dev->base_addr;
1485#endif
1486 printk(KERN_INFO "%s: SC92031 at 0x%lx, %pM, IRQ %d\n", dev->name, 1473 printk(KERN_INFO "%s: SC92031 at 0x%lx, %pM, IRQ %d\n", dev->name,
1487 base_addr, dev->dev_addr, dev->irq); 1474 (long)pci_resource_start(pdev, SC92031_USE_PIO), dev->dev_addr,
1475 pdev->irq);
1488 1476
1489 return 0; 1477 return 0;
1490 1478