]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/net/ethernet/smsc/smsc911x.c
Merge branches 'pm-core', 'pm-qos' and 'pm-avs'
[mirror_ubuntu-artful-kernel.git] / drivers / net / ethernet / smsc / smsc911x.c
index e9b8579e6241476bd2c82486a0e1a91b2cafcad7..6fb2d15b535132fafce6425666efc01e5c7809d7 100644 (file)
@@ -438,9 +438,16 @@ static int smsc911x_request_resources(struct platform_device *pdev)
        ret = regulator_bulk_get(&pdev->dev,
                        ARRAY_SIZE(pdata->supplies),
                        pdata->supplies);
-       if (ret)
+       if (ret) {
+               /*
+                * Retry on deferrals, else just report the error
+                * and try to continue.
+                */
+               if (ret == -EPROBE_DEFER)
+                       return ret;
                netdev_err(ndev, "couldn't get regulators %d\n",
                                ret);
+       }
 
        /* Request optional RESET GPIO */
        pdata->reset_gpiod = devm_gpiod_get_optional(&pdev->dev,
@@ -2584,6 +2591,9 @@ static int smsc911x_suspend(struct device *dev)
                PMT_CTRL_PM_MODE_D1_ | PMT_CTRL_WOL_EN_ |
                PMT_CTRL_ED_EN_ | PMT_CTRL_PME_EN_);
 
+       pm_runtime_disable(dev);
+       pm_runtime_set_suspended(dev);
+
        return 0;
 }
 
@@ -2593,6 +2603,9 @@ static int smsc911x_resume(struct device *dev)
        struct smsc911x_data *pdata = netdev_priv(ndev);
        unsigned int to = 100;
 
+       pm_runtime_enable(dev);
+       pm_runtime_resume(dev);
+
        /* Note 3.11 from the datasheet:
         *      "When the LAN9220 is in a power saving state, a write of any
         *       data to the BYTE_TEST register will wake-up the device."