]> err.no Git - linux-2.6/commitdiff
natsemi: Check return value for pci_enable_device()
authorMark Brown <broonie@sirena.org.uk>
Wed, 10 Oct 2007 16:11:12 +0000 (17:11 +0100)
committerJeff Garzik <jeff@garzik.org>
Mon, 15 Oct 2007 18:20:45 +0000 (14:20 -0400)
pci_enable_device() is __must_check so do that in natsemi_resume().

Signed-off-by: Mark Brown <broonie@sirena.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/natsemi.c

index b881786eebd492722ffb01294474ecbce683fed7..50e1ec67ef9c5f4d0fa9419b03de64961e3c3962 100644 (file)
@@ -3314,13 +3314,19 @@ static int natsemi_resume (struct pci_dev *pdev)
 {
        struct net_device *dev = pci_get_drvdata (pdev);
        struct netdev_private *np = netdev_priv(dev);
+       int ret = 0;
 
        rtnl_lock();
        if (netif_device_present(dev))
                goto out;
        if (netif_running(dev)) {
                BUG_ON(!np->hands_off);
-               pci_enable_device(pdev);
+               ret = pci_enable_device(pdev);
+               if (ret < 0) {
+                       dev_err(&pdev->dev,
+                               "pci_enable_device() failed: %d\n", ret);
+                       goto out;
+               }
        /*      pci_power_on(pdev); */
 
                napi_enable(&np->napi);
@@ -3340,7 +3346,7 @@ static int natsemi_resume (struct pci_dev *pdev)
        netif_device_attach(dev);
 out:
        rtnl_unlock();
-       return 0;
+       return ret;
 }
 
 #endif /* CONFIG_PM */