diff options
| -rw-r--r-- | drivers/net/e100.c | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index 36ba6dc96acc..cdf3090a1885 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c | |||
| @@ -2782,16 +2782,13 @@ static void __devexit e100_remove(struct pci_dev *pdev) | |||
| 2782 | } | 2782 | } |
| 2783 | } | 2783 | } |
| 2784 | 2784 | ||
| 2785 | #ifdef CONFIG_PM | ||
| 2786 | static int e100_suspend(struct pci_dev *pdev, pm_message_t state) | 2785 | static int e100_suspend(struct pci_dev *pdev, pm_message_t state) |
| 2787 | { | 2786 | { |
| 2788 | struct net_device *netdev = pci_get_drvdata(pdev); | 2787 | struct net_device *netdev = pci_get_drvdata(pdev); |
| 2789 | struct nic *nic = netdev_priv(netdev); | 2788 | struct nic *nic = netdev_priv(netdev); |
| 2790 | 2789 | ||
| 2791 | if (netif_running(netdev)) | 2790 | if (netif_running(netdev)) |
| 2792 | napi_disable(&nic->napi); | 2791 | e100_down(nic); |
| 2793 | del_timer_sync(&nic->watchdog); | ||
| 2794 | netif_carrier_off(nic->netdev); | ||
| 2795 | netif_device_detach(netdev); | 2792 | netif_device_detach(netdev); |
| 2796 | 2793 | ||
| 2797 | pci_save_state(pdev); | 2794 | pci_save_state(pdev); |
| @@ -2804,14 +2801,13 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state) | |||
| 2804 | pci_enable_wake(pdev, PCI_D3cold, 0); | 2801 | pci_enable_wake(pdev, PCI_D3cold, 0); |
| 2805 | } | 2802 | } |
| 2806 | 2803 | ||
| 2807 | free_irq(pdev->irq, netdev); | ||
| 2808 | |||
| 2809 | pci_disable_device(pdev); | 2804 | pci_disable_device(pdev); |
| 2810 | pci_set_power_state(pdev, PCI_D3hot); | 2805 | pci_set_power_state(pdev, PCI_D3hot); |
| 2811 | 2806 | ||
| 2812 | return 0; | 2807 | return 0; |
| 2813 | } | 2808 | } |
| 2814 | 2809 | ||
| 2810 | #ifdef CONFIG_PM | ||
| 2815 | static int e100_resume(struct pci_dev *pdev) | 2811 | static int e100_resume(struct pci_dev *pdev) |
| 2816 | { | 2812 | { |
| 2817 | struct net_device *netdev = pci_get_drvdata(pdev); | 2813 | struct net_device *netdev = pci_get_drvdata(pdev); |
| @@ -2832,26 +2828,7 @@ static int e100_resume(struct pci_dev *pdev) | |||
| 2832 | 2828 | ||
| 2833 | static void e100_shutdown(struct pci_dev *pdev) | 2829 | static void e100_shutdown(struct pci_dev *pdev) |
| 2834 | { | 2830 | { |
| 2835 | struct net_device *netdev = pci_get_drvdata(pdev); | 2831 | e100_suspend(pdev, PMSG_SUSPEND); |
| 2836 | struct nic *nic = netdev_priv(netdev); | ||
| 2837 | |||
| 2838 | if (netif_running(netdev)) | ||
| 2839 | napi_disable(&nic->napi); | ||
| 2840 | del_timer_sync(&nic->watchdog); | ||
| 2841 | netif_carrier_off(nic->netdev); | ||
| 2842 | |||
| 2843 | if ((nic->flags & wol_magic) | e100_asf(nic)) { | ||
| 2844 | pci_enable_wake(pdev, PCI_D3hot, 1); | ||
| 2845 | pci_enable_wake(pdev, PCI_D3cold, 1); | ||
| 2846 | } else { | ||
| 2847 | pci_enable_wake(pdev, PCI_D3hot, 0); | ||
| 2848 | pci_enable_wake(pdev, PCI_D3cold, 0); | ||
| 2849 | } | ||
| 2850 | |||
| 2851 | free_irq(pdev->irq, netdev); | ||
| 2852 | |||
| 2853 | pci_disable_device(pdev); | ||
| 2854 | pci_set_power_state(pdev, PCI_D3hot); | ||
| 2855 | } | 2832 | } |
| 2856 | 2833 | ||
| 2857 | /* ------------------ PCI Error Recovery infrastructure -------------- */ | 2834 | /* ------------------ PCI Error Recovery infrastructure -------------- */ |
