PM / Runtime: Rework the "runtime idle" helper routine
[firefly-linux-kernel-4.4.55.git] / drivers / pci / pci-driver.c
index 66aabde827277dd533b47b7ba9bfd5ddf5ff1888..6f9b44b541e47f25f2b80404a643c4ab06c50529 100644 (file)
@@ -1056,26 +1056,22 @@ static int pci_pm_runtime_idle(struct device *dev)
 {
        struct pci_dev *pci_dev = to_pci_dev(dev);
        const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
+       int ret = 0;
 
        /*
         * If pci_dev->driver is not set (unbound), the device should
         * always remain in D0 regardless of the runtime PM status
         */
        if (!pci_dev->driver)
-               goto out;
+               return 0;
 
        if (!pm)
                return -ENOSYS;
 
-       if (pm->runtime_idle) {
-               int ret = pm->runtime_idle(dev);
-               if (ret)
-                       return ret;
-       }
+       if (pm->runtime_idle)
+               ret = pm->runtime_idle(dev);
 
-out:
-       pm_runtime_suspend(dev);
-       return 0;
+       return ret;
 }
 
 #else /* !CONFIG_PM_RUNTIME */