diff options
author | Francois Romieu <romieu@fr.zoreil.com> | 2012-03-09 05:58:08 -0500 |
---|---|---|
committer | Francois Romieu <romieu@fr.zoreil.com> | 2012-04-07 05:45:25 -0400 |
commit | a69afe3263717ba9384cf18d05722c598f6820af (patch) | |
tree | 6f32edf7d0bc000d9402ab7c9266b520f7711340 | |
parent | 80777c54d2a6ebeff783b638e92fba40f0881ba5 (diff) |
8139cp: stop using net_device.{base_addr, irq}.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
-rw-r--r-- | drivers/net/ethernet/realtek/8139cp.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c index abc79076f867..69c7d695807c 100644 --- a/drivers/net/ethernet/realtek/8139cp.c +++ b/drivers/net/ethernet/realtek/8139cp.c | |||
@@ -635,9 +635,12 @@ static irqreturn_t cp_interrupt (int irq, void *dev_instance) | |||
635 | */ | 635 | */ |
636 | static void cp_poll_controller(struct net_device *dev) | 636 | static void cp_poll_controller(struct net_device *dev) |
637 | { | 637 | { |
638 | disable_irq(dev->irq); | 638 | struct cp_private *cp = netdev_priv(dev); |
639 | cp_interrupt(dev->irq, dev); | 639 | const int irq = cp->pdev->irq; |
640 | enable_irq(dev->irq); | 640 | |
641 | disable_irq(irq); | ||
642 | cp_interrupt(irq, dev); | ||
643 | enable_irq(irq); | ||
641 | } | 644 | } |
642 | #endif | 645 | #endif |
643 | 646 | ||
@@ -1114,6 +1117,7 @@ static void cp_free_rings (struct cp_private *cp) | |||
1114 | static int cp_open (struct net_device *dev) | 1117 | static int cp_open (struct net_device *dev) |
1115 | { | 1118 | { |
1116 | struct cp_private *cp = netdev_priv(dev); | 1119 | struct cp_private *cp = netdev_priv(dev); |
1120 | const int irq = cp->pdev->irq; | ||
1117 | int rc; | 1121 | int rc; |
1118 | 1122 | ||
1119 | netif_dbg(cp, ifup, dev, "enabling interface\n"); | 1123 | netif_dbg(cp, ifup, dev, "enabling interface\n"); |
@@ -1126,7 +1130,7 @@ static int cp_open (struct net_device *dev) | |||
1126 | 1130 | ||
1127 | cp_init_hw(cp); | 1131 | cp_init_hw(cp); |
1128 | 1132 | ||
1129 | rc = request_irq(dev->irq, cp_interrupt, IRQF_SHARED, dev->name, dev); | 1133 | rc = request_irq(irq, cp_interrupt, IRQF_SHARED, dev->name, dev); |
1130 | if (rc) | 1134 | if (rc) |
1131 | goto err_out_hw; | 1135 | goto err_out_hw; |
1132 | 1136 | ||
@@ -1161,7 +1165,7 @@ static int cp_close (struct net_device *dev) | |||
1161 | 1165 | ||
1162 | spin_unlock_irqrestore(&cp->lock, flags); | 1166 | spin_unlock_irqrestore(&cp->lock, flags); |
1163 | 1167 | ||
1164 | free_irq(dev->irq, dev); | 1168 | free_irq(cp->pdev->irq, dev); |
1165 | 1169 | ||
1166 | cp_free_rings(cp); | 1170 | cp_free_rings(cp); |
1167 | return 0; | 1171 | return 0; |
@@ -1909,7 +1913,6 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1909 | (unsigned long long)pciaddr); | 1913 | (unsigned long long)pciaddr); |
1910 | goto err_out_res; | 1914 | goto err_out_res; |
1911 | } | 1915 | } |
1912 | dev->base_addr = (unsigned long) regs; | ||
1913 | cp->regs = regs; | 1916 | cp->regs = regs; |
1914 | 1917 | ||
1915 | cp_stop_hw(cp); | 1918 | cp_stop_hw(cp); |
@@ -1937,14 +1940,12 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1937 | dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO | | 1940 | dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO | |
1938 | NETIF_F_HIGHDMA; | 1941 | NETIF_F_HIGHDMA; |
1939 | 1942 | ||
1940 | dev->irq = pdev->irq; | ||
1941 | |||
1942 | rc = register_netdev(dev); | 1943 | rc = register_netdev(dev); |
1943 | if (rc) | 1944 | if (rc) |
1944 | goto err_out_iomap; | 1945 | goto err_out_iomap; |
1945 | 1946 | ||
1946 | netdev_info(dev, "RTL-8139C+ at 0x%lx, %pM, IRQ %d\n", | 1947 | netdev_info(dev, "RTL-8139C+ at 0x%p, %pM, IRQ %d\n", |
1947 | dev->base_addr, dev->dev_addr, dev->irq); | 1948 | regs, dev->dev_addr, pdev->irq); |
1948 | 1949 | ||
1949 | pci_set_drvdata(pdev, dev); | 1950 | pci_set_drvdata(pdev, dev); |
1950 | 1951 | ||