diff options
author | Francois Romieu <romieu@fr.zoreil.com> | 2012-03-09 17:37:01 -0500 |
---|---|---|
committer | Francois Romieu <romieu@fr.zoreil.com> | 2012-04-07 05:45:26 -0400 |
commit | c0bd55efd7b7ea8346ec3b5ce8414f978fede1f5 (patch) | |
tree | ef18bc262f79f5ba7ab87be7fe2d8c6032b9101c /drivers/net/ethernet/dec | |
parent | c0357e975afdbbedab5c662d19bef865f02adc17 (diff) |
winbond840: stop using net_device.{base_addr, irq}.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Diffstat (limited to 'drivers/net/ethernet/dec')
-rw-r--r-- | drivers/net/ethernet/dec/tulip/winbond-840.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/net/ethernet/dec/tulip/winbond-840.c b/drivers/net/ethernet/dec/tulip/winbond-840.c index 2ac6fff0363a..4d1ffca83c82 100644 --- a/drivers/net/ethernet/dec/tulip/winbond-840.c +++ b/drivers/net/ethernet/dec/tulip/winbond-840.c | |||
@@ -400,9 +400,6 @@ static int __devinit w840_probe1 (struct pci_dev *pdev, | |||
400 | No hold time required! */ | 400 | No hold time required! */ |
401 | iowrite32(0x00000001, ioaddr + PCIBusCfg); | 401 | iowrite32(0x00000001, ioaddr + PCIBusCfg); |
402 | 402 | ||
403 | dev->base_addr = (unsigned long)ioaddr; | ||
404 | dev->irq = irq; | ||
405 | |||
406 | np = netdev_priv(dev); | 403 | np = netdev_priv(dev); |
407 | np->pci_dev = pdev; | 404 | np->pci_dev = pdev; |
408 | np->chip_id = chip_idx; | 405 | np->chip_id = chip_idx; |
@@ -635,17 +632,18 @@ static int netdev_open(struct net_device *dev) | |||
635 | { | 632 | { |
636 | struct netdev_private *np = netdev_priv(dev); | 633 | struct netdev_private *np = netdev_priv(dev); |
637 | void __iomem *ioaddr = np->base_addr; | 634 | void __iomem *ioaddr = np->base_addr; |
635 | const int irq = np->pci_dev->irq; | ||
638 | int i; | 636 | int i; |
639 | 637 | ||
640 | iowrite32(0x00000001, ioaddr + PCIBusCfg); /* Reset */ | 638 | iowrite32(0x00000001, ioaddr + PCIBusCfg); /* Reset */ |
641 | 639 | ||
642 | netif_device_detach(dev); | 640 | netif_device_detach(dev); |
643 | i = request_irq(dev->irq, intr_handler, IRQF_SHARED, dev->name, dev); | 641 | i = request_irq(irq, intr_handler, IRQF_SHARED, dev->name, dev); |
644 | if (i) | 642 | if (i) |
645 | goto out_err; | 643 | goto out_err; |
646 | 644 | ||
647 | if (debug > 1) | 645 | if (debug > 1) |
648 | netdev_dbg(dev, "w89c840_open() irq %d\n", dev->irq); | 646 | netdev_dbg(dev, "w89c840_open() irq %d\n", irq); |
649 | 647 | ||
650 | if((i=alloc_ringdesc(dev))) | 648 | if((i=alloc_ringdesc(dev))) |
651 | goto out_err; | 649 | goto out_err; |
@@ -932,6 +930,7 @@ static void tx_timeout(struct net_device *dev) | |||
932 | { | 930 | { |
933 | struct netdev_private *np = netdev_priv(dev); | 931 | struct netdev_private *np = netdev_priv(dev); |
934 | void __iomem *ioaddr = np->base_addr; | 932 | void __iomem *ioaddr = np->base_addr; |
933 | const int irq = np->pci_dev->irq; | ||
935 | 934 | ||
936 | dev_warn(&dev->dev, "Transmit timed out, status %08x, resetting...\n", | 935 | dev_warn(&dev->dev, "Transmit timed out, status %08x, resetting...\n", |
937 | ioread32(ioaddr + IntrStatus)); | 936 | ioread32(ioaddr + IntrStatus)); |
@@ -951,7 +950,7 @@ static void tx_timeout(struct net_device *dev) | |||
951 | np->cur_tx, np->dirty_tx, np->tx_full, np->tx_q_bytes); | 950 | np->cur_tx, np->dirty_tx, np->tx_full, np->tx_q_bytes); |
952 | printk(KERN_DEBUG "Tx Descriptor addr %xh\n", ioread32(ioaddr+0x4C)); | 951 | printk(KERN_DEBUG "Tx Descriptor addr %xh\n", ioread32(ioaddr+0x4C)); |
953 | 952 | ||
954 | disable_irq(dev->irq); | 953 | disable_irq(irq); |
955 | spin_lock_irq(&np->lock); | 954 | spin_lock_irq(&np->lock); |
956 | /* | 955 | /* |
957 | * Under high load dirty_tx and the internal tx descriptor pointer | 956 | * Under high load dirty_tx and the internal tx descriptor pointer |
@@ -966,7 +965,7 @@ static void tx_timeout(struct net_device *dev) | |||
966 | init_rxtx_rings(dev); | 965 | init_rxtx_rings(dev); |
967 | init_registers(dev); | 966 | init_registers(dev); |
968 | spin_unlock_irq(&np->lock); | 967 | spin_unlock_irq(&np->lock); |
969 | enable_irq(dev->irq); | 968 | enable_irq(irq); |
970 | 969 | ||
971 | netif_wake_queue(dev); | 970 | netif_wake_queue(dev); |
972 | dev->trans_start = jiffies; /* prevent tx timeout */ | 971 | dev->trans_start = jiffies; /* prevent tx timeout */ |
@@ -1500,7 +1499,7 @@ static int netdev_close(struct net_device *dev) | |||
1500 | iowrite32(0x0000, ioaddr + IntrEnable); | 1499 | iowrite32(0x0000, ioaddr + IntrEnable); |
1501 | spin_unlock_irq(&np->lock); | 1500 | spin_unlock_irq(&np->lock); |
1502 | 1501 | ||
1503 | free_irq(dev->irq, dev); | 1502 | free_irq(np->pci_dev->irq, dev); |
1504 | wmb(); | 1503 | wmb(); |
1505 | netif_device_attach(dev); | 1504 | netif_device_attach(dev); |
1506 | 1505 | ||
@@ -1589,7 +1588,7 @@ static int w840_suspend (struct pci_dev *pdev, pm_message_t state) | |||
1589 | iowrite32(0, ioaddr + IntrEnable); | 1588 | iowrite32(0, ioaddr + IntrEnable); |
1590 | spin_unlock_irq(&np->lock); | 1589 | spin_unlock_irq(&np->lock); |
1591 | 1590 | ||
1592 | synchronize_irq(dev->irq); | 1591 | synchronize_irq(np->pci_dev->irq); |
1593 | netif_tx_disable(dev); | 1592 | netif_tx_disable(dev); |
1594 | 1593 | ||
1595 | np->stats.rx_missed_errors += ioread32(ioaddr + RxMissed) & 0xffff; | 1594 | np->stats.rx_missed_errors += ioread32(ioaddr + RxMissed) & 0xffff; |