aboutsummaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2011-07-12 00:39:48 +0200
committerRafael J. Wysocki <rjw@sisk.pl>2011-07-12 00:39:48 +0200
commit697a7f3727b53c7d4c927948bbe1f6afc4fabfde (patch)
treed57da1cbcc7d0c72d1549aba1a19def94141773d /drivers/base
parentc6d22b37263607ba5aeeb2e11169fa65caa29bee (diff)
PM / Domains: Do not restore all devices on power off error
Since every device in a PM domain has its own need_restore flag, which is set by __pm_genpd_save_device(), there's no need to walk the domain's device list and restore all devices on an error from one of the drivers' .runtime_suspend() callbacks. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/domain.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 7e6cc8a5ce5..7b20801d19d 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -269,8 +269,10 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
list_for_each_entry_reverse(dle, &genpd->dev_list, node) {
ret = __pm_genpd_save_device(dle, genpd);
- if (ret)
- goto err_dev;
+ if (ret) {
+ genpd_set_active(genpd);
+ goto out;
+ }
if (genpd_abort_poweroff(genpd))
goto out;
@@ -311,13 +313,6 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
genpd->poweroff_task = NULL;
wake_up_all(&genpd->status_wait_queue);
return ret;
-
- err_dev:
- list_for_each_entry_continue(dle, &genpd->dev_list, node)
- __pm_genpd_restore_device(dle, genpd);
-
- genpd_set_active(genpd);
- goto out;
}
/**