diff options
Diffstat (limited to 'drivers/net/tulip/tulip_core.c')
| -rw-r--r-- | drivers/net/tulip/tulip_core.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c index f9d13fa05d64..af8d2c436efd 100644 --- a/drivers/net/tulip/tulip_core.c +++ b/drivers/net/tulip/tulip_core.c | |||
| @@ -731,7 +731,7 @@ static void tulip_down (struct net_device *dev) | |||
| 731 | void __iomem *ioaddr = tp->base_addr; | 731 | void __iomem *ioaddr = tp->base_addr; |
| 732 | unsigned long flags; | 732 | unsigned long flags; |
| 733 | 733 | ||
| 734 | flush_scheduled_work(); | 734 | cancel_work_sync(&tp->media_work); |
| 735 | 735 | ||
| 736 | #ifdef CONFIG_TULIP_NAPI | 736 | #ifdef CONFIG_TULIP_NAPI |
| 737 | napi_disable(&tp->napi); | 737 | napi_disable(&tp->napi); |
| @@ -1729,12 +1729,15 @@ static int tulip_suspend (struct pci_dev *pdev, pm_message_t state) | |||
| 1729 | if (!dev) | 1729 | if (!dev) |
| 1730 | return -EINVAL; | 1730 | return -EINVAL; |
| 1731 | 1731 | ||
| 1732 | if (netif_running(dev)) | 1732 | if (!netif_running(dev)) |
| 1733 | tulip_down(dev); | 1733 | goto save_state; |
| 1734 | |||
| 1735 | tulip_down(dev); | ||
| 1734 | 1736 | ||
| 1735 | netif_device_detach(dev); | 1737 | netif_device_detach(dev); |
| 1736 | free_irq(dev->irq, dev); | 1738 | free_irq(dev->irq, dev); |
| 1737 | 1739 | ||
| 1740 | save_state: | ||
| 1738 | pci_save_state(pdev); | 1741 | pci_save_state(pdev); |
| 1739 | pci_disable_device(pdev); | 1742 | pci_disable_device(pdev); |
| 1740 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); | 1743 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); |
| @@ -1754,6 +1757,9 @@ static int tulip_resume(struct pci_dev *pdev) | |||
| 1754 | pci_set_power_state(pdev, PCI_D0); | 1757 | pci_set_power_state(pdev, PCI_D0); |
| 1755 | pci_restore_state(pdev); | 1758 | pci_restore_state(pdev); |
| 1756 | 1759 | ||
| 1760 | if (!netif_running(dev)) | ||
| 1761 | return 0; | ||
| 1762 | |||
| 1757 | if ((retval = pci_enable_device(pdev))) { | 1763 | if ((retval = pci_enable_device(pdev))) { |
| 1758 | printk (KERN_ERR "tulip: pci_enable_device failed in resume\n"); | 1764 | printk (KERN_ERR "tulip: pci_enable_device failed in resume\n"); |
| 1759 | return retval; | 1765 | return retval; |
