diff options
author | Shuah Khan <shuah.kh@samsung.com> | 2013-09-11 17:23:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-11 18:58:15 -0400 |
commit | 729377d559607ea40d714e8f7092f40f643cf01f (patch) | |
tree | 5d05912ee3c2974067578bc914d8b5dfc0955d24 /drivers/pnp | |
parent | 2bff24a3707093c435ab3241c47dcdb5f16e432b (diff) |
pnp: change pnp bus pm_ops to invoke pnp driver dev_pm_ops if specified
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 <shuah.kh@samsung.com>
Cc: Matthew Garrett <matthew.garrett@nebula.com>
Cc: Leonidas Da Silva Barbosa <leosilva@linux.vnet.ibm.com>
Cc: Ashley Lai <ashley@ashleylai.com>
Cc: Rajiv Andrade <mail@srajiv.net>
Cc: Marcel Selhorst <tpmdd@selhorst.net>
Cc: Sirrix AG <tpmdd@sirrix.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Peter Hüwe <PeterHuewe@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/pnp')
-rw-r--r-- | drivers/pnp/driver.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c index 12adb43a0693..a39ee38a9414 100644 --- a/drivers/pnp/driver.c +++ b/drivers/pnp/driver.c | |||
@@ -163,6 +163,13 @@ static int __pnp_bus_suspend(struct device *dev, pm_message_t state) | |||
163 | if (!pnp_drv) | 163 | if (!pnp_drv) |
164 | return 0; | 164 | return 0; |
165 | 165 | ||
166 | if (pnp_drv->driver.pm && pnp_drv->driver.pm->suspend) { | ||
167 | error = pnp_drv->driver.pm->suspend(dev); | ||
168 | suspend_report_result(pnp_drv->driver.pm->suspend, error); | ||
169 | if (error) | ||
170 | return error; | ||
171 | } | ||
172 | |||
166 | if (pnp_drv->suspend) { | 173 | if (pnp_drv->suspend) { |
167 | error = pnp_drv->suspend(pnp_dev, state); | 174 | error = pnp_drv->suspend(pnp_dev, state); |
168 | if (error) | 175 | if (error) |
@@ -211,6 +218,12 @@ static int pnp_bus_resume(struct device *dev) | |||
211 | return error; | 218 | return error; |
212 | } | 219 | } |
213 | 220 | ||
221 | if (pnp_drv->driver.pm && pnp_drv->driver.pm->resume) { | ||
222 | error = pnp_drv->driver.pm->resume(dev); | ||
223 | if (error) | ||
224 | return error; | ||
225 | } | ||
226 | |||
214 | if (pnp_drv->resume) { | 227 | if (pnp_drv->resume) { |
215 | error = pnp_drv->resume(pnp_dev); | 228 | error = pnp_drv->resume(pnp_dev); |
216 | if (error) | 229 | if (error) |