diff options
| author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-07-14 14:59:20 -0400 |
|---|---|---|
| committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-07-14 14:59:20 -0400 |
| commit | d28054020f97c7c9f15327a53945f0f40ffc5d7a (patch) | |
| tree | 0c1d4dcef6eca9c5fe6a435d8a86d51c373d90c8 /drivers/base | |
| parent | 0bc5b2debb832191a42baea7ff59d2ca6ce9f7d5 (diff) | |
PM / Domains: Take .power_off() error code into account
Currently pm_genpd_poweroff() discards error codes returned by
the PM domain's .power_off() callback, because it's safer to always
regard the domain as inaccessible to drivers after a failing
.power_off(). Still, there are situations in which the low-level
code may want to indicate that it doesn't want to power off the
domain, so allow it to do that by returning -EBUSY from .power_off().
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Magnus Damm <damm@opensource.se>
Diffstat (limited to 'drivers/base')
| -rw-r--r-- | drivers/base/power/domain.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 00ed4f32a4de..be8714aa9dd6 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c | |||
| @@ -312,8 +312,16 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd) | |||
| 312 | } | 312 | } |
| 313 | } | 313 | } |
| 314 | 314 | ||
| 315 | if (genpd->power_off) | 315 | if (genpd->power_off) { |
| 316 | genpd->power_off(genpd); | 316 | ret = genpd->power_off(genpd); |
| 317 | if (ret == -EBUSY) { | ||
| 318 | genpd_set_active(genpd); | ||
| 319 | if (parent) | ||
| 320 | genpd_release_lock(parent); | ||
| 321 | |||
| 322 | goto out; | ||
| 323 | } | ||
| 324 | } | ||
| 317 | 325 | ||
| 318 | genpd->status = GPD_STATE_POWER_OFF; | 326 | genpd->status = GPD_STATE_POWER_OFF; |
| 319 | 327 | ||
