diff options
-rw-r--r-- | drivers/net/pcnet32.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c index b61c97254b3f..16964ec73e67 100644 --- a/drivers/net/pcnet32.c +++ b/drivers/net/pcnet32.c | |||
@@ -1722,7 +1722,9 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
1722 | ret = -ENOMEM; | 1722 | ret = -ENOMEM; |
1723 | goto err_release_region; | 1723 | goto err_release_region; |
1724 | } | 1724 | } |
1725 | SET_NETDEV_DEV(dev, &pdev->dev); | 1725 | |
1726 | if (pdev) | ||
1727 | SET_NETDEV_DEV(dev, &pdev->dev); | ||
1726 | 1728 | ||
1727 | if (pcnet32_debug & NETIF_MSG_PROBE) | 1729 | if (pcnet32_debug & NETIF_MSG_PROBE) |
1728 | printk(KERN_INFO PFX "%s at %#3lx,", chipname, ioaddr); | 1730 | printk(KERN_INFO PFX "%s at %#3lx,", chipname, ioaddr); |
@@ -1821,7 +1823,6 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
1821 | 1823 | ||
1822 | spin_lock_init(&lp->lock); | 1824 | spin_lock_init(&lp->lock); |
1823 | 1825 | ||
1824 | SET_NETDEV_DEV(dev, &pdev->dev); | ||
1825 | lp->name = chipname; | 1826 | lp->name = chipname; |
1826 | lp->shared_irq = shared; | 1827 | lp->shared_irq = shared; |
1827 | lp->tx_ring_size = TX_RING_SIZE; /* default tx ring size */ | 1828 | lp->tx_ring_size = TX_RING_SIZE; /* default tx ring size */ |
@@ -2085,6 +2086,7 @@ static void pcnet32_free_ring(struct net_device *dev) | |||
2085 | static int pcnet32_open(struct net_device *dev) | 2086 | static int pcnet32_open(struct net_device *dev) |
2086 | { | 2087 | { |
2087 | struct pcnet32_private *lp = netdev_priv(dev); | 2088 | struct pcnet32_private *lp = netdev_priv(dev); |
2089 | struct pci_dev *pdev = lp->pci_dev; | ||
2088 | unsigned long ioaddr = dev->base_addr; | 2090 | unsigned long ioaddr = dev->base_addr; |
2089 | u16 val; | 2091 | u16 val; |
2090 | int i; | 2092 | int i; |
@@ -2145,9 +2147,9 @@ static int pcnet32_open(struct net_device *dev) | |||
2145 | lp->a.write_csr(ioaddr, 124, val); | 2147 | lp->a.write_csr(ioaddr, 124, val); |
2146 | 2148 | ||
2147 | /* Allied Telesyn AT 2700/2701 FX are 100Mbit only and do not negotiate */ | 2149 | /* Allied Telesyn AT 2700/2701 FX are 100Mbit only and do not negotiate */ |
2148 | if (lp->pci_dev->subsystem_vendor == PCI_VENDOR_ID_AT && | 2150 | if (pdev && pdev->subsystem_vendor == PCI_VENDOR_ID_AT && |
2149 | (lp->pci_dev->subsystem_device == PCI_SUBDEVICE_ID_AT_2700FX || | 2151 | (pdev->subsystem_device == PCI_SUBDEVICE_ID_AT_2700FX || |
2150 | lp->pci_dev->subsystem_device == PCI_SUBDEVICE_ID_AT_2701FX)) { | 2152 | pdev->subsystem_device == PCI_SUBDEVICE_ID_AT_2701FX)) { |
2151 | if (lp->options & PCNET32_PORT_ASEL) { | 2153 | if (lp->options & PCNET32_PORT_ASEL) { |
2152 | lp->options = PCNET32_PORT_FD | PCNET32_PORT_100; | 2154 | lp->options = PCNET32_PORT_FD | PCNET32_PORT_100; |
2153 | if (netif_msg_link(lp)) | 2155 | if (netif_msg_link(lp)) |