===================================================================
@@ -623,10 +623,13 @@ static int pci_pm_prepare(struct device
* system from the sleep state, we'll have to prevent it from signaling
* wake-up.
*/
- pm_runtime_resume(dev);
+ pm_runtime_get_sync(dev);
- if (drv && drv->pm && drv->pm->prepare)
+ if (drv && drv->pm && drv->pm->prepare) {
error = drv->pm->prepare(dev);
+ if (error)
+ pm_runtime_put_sync(dev);
+ }
return error;
}
@@ -637,6 +640,7 @@ static void pci_pm_complete(struct devic
if (drv && drv->pm && drv->pm->complete)
drv->pm->complete(dev);
+ pm_runtime_put_sync(dev);
}
#else /* !CONFIG_PM_SLEEP */