]> Git Repo - linux.git/commitdiff
pnp: change pnp bus pm_ops to invoke pnp driver dev_pm_ops if specified
authorShuah Khan <[email protected]>
Wed, 11 Sep 2013 21:23:09 +0000 (14:23 -0700)
committerLinus Torvalds <[email protected]>
Wed, 11 Sep 2013 22:58:15 +0000 (15:58 -0700)
pnp_bus_suspend() and pnp_bus_resume() invoke legacy pm_ops from
pnp_driver.  Changed pnp_bus_suspend() and pnp_bus_resume() to check if
pnp driver has dev_pm_ops and call.  If dev_pm_ops don't exist, then call
use legacy pm_ops.  Without this change, pnp_driver dev_pm_ops will not
get called.

In addition to the pnp driver bus pm_ops change to invoke driver
dev_pm_ops, this patch set contains changes to rtc-cmos, tpm_tis, and
apple-gmux pnp drivers to convert from legacy pm_ops to dev_pm_ops.

This patch (of 4):

pnp_bus_suspend() and pnp_bus_resume() invoke legacy pm_ops from
pnp_driver.  Changed pnp_bus_suspend() and pnp_bus_resume() to check if
pnp driver has dev_pm_ops and call.  If dev_pm_ops don't exist, then call
use legacy pm_ops.  Without this change, pnp_driver dev_pm_ops will not
get called.

Signed-off-by: Shuah Khan <[email protected]>
Cc: Matthew Garrett <[email protected]>
Cc: Leonidas Da Silva Barbosa <[email protected]>
Cc: Ashley Lai <[email protected]>
Cc: Rajiv Andrade <[email protected]>
Cc: Marcel Selhorst <[email protected]>
Cc: Sirrix AG <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Cc: Bjorn Helgaas <[email protected]>
Cc: Grant Likely <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Peter Hüwe <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/pnp/driver.c

index 12adb43a069317da31958ac4913418c385cedb77..a39ee38a9414cece2b0742e05f2cf5260a0fc842 100644 (file)
@@ -163,6 +163,13 @@ static int __pnp_bus_suspend(struct device *dev, pm_message_t state)
        if (!pnp_drv)
                return 0;
 
+       if (pnp_drv->driver.pm && pnp_drv->driver.pm->suspend) {
+               error = pnp_drv->driver.pm->suspend(dev);
+               suspend_report_result(pnp_drv->driver.pm->suspend, error);
+               if (error)
+                       return error;
+       }
+
        if (pnp_drv->suspend) {
                error = pnp_drv->suspend(pnp_dev, state);
                if (error)
@@ -211,6 +218,12 @@ static int pnp_bus_resume(struct device *dev)
                        return error;
        }
 
+       if (pnp_drv->driver.pm && pnp_drv->driver.pm->resume) {
+               error = pnp_drv->driver.pm->resume(dev);
+               if (error)
+                       return error;
+       }
+
        if (pnp_drv->resume) {
                error = pnp_drv->resume(pnp_dev);
                if (error)
This page took 0.053723 seconds and 4 git commands to generate.