tlan: Enable device at resume
authorOndrej Zary <linux@rainbow-software.org>
Mon, 30 Jun 2014 16:38:36 +0000 (18:38 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 8 Jul 2014 00:06:52 +0000 (17:06 -0700)
pci_disable_device() is called in _suspend but there's no corresponding
pci_enable_device() in _resume.
This causes "disabling already-disabled device" warning on 2nd suspend.

Add pci_enable_device() call to _resume to fix this problem.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/tlan.c

index 50ac9e7b927f4e5482b2c7c863de6269cf8323d5..1f21764fea53f8c22ce98be3beed36854ef901a8 100644 (file)
@@ -365,8 +365,10 @@ static int tlan_suspend(struct pci_dev *pdev, pm_message_t state)
 static int tlan_resume(struct pci_dev *pdev)
 {
        struct net_device *dev = pci_get_drvdata(pdev);
+       int rc = pci_enable_device(pdev);
 
-       pci_set_power_state(pdev, PCI_D0);
+       if (rc)
+               return rc;
        pci_restore_state(pdev);
        pci_enable_wake(pdev, PCI_D0, 0);
        netif_device_attach(dev);