diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-07-11 18:39:48 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-07-11 18:39:48 -0400 |
commit | 697a7f3727b53c7d4c927948bbe1f6afc4fabfde (patch) | |
tree | d57da1cbcc7d0c72d1549aba1a19def94141773d /drivers/base | |
parent | c6d22b37263607ba5aeeb2e11169fa65caa29bee (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.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 7e6cc8a5ce5b..7b20801d19da 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) | |||
269 | 269 | ||
270 | list_for_each_entry_reverse(dle, &genpd->dev_list, node) { | 270 | list_for_each_entry_reverse(dle, &genpd->dev_list, node) { |
271 | ret = __pm_genpd_save_device(dle, genpd); | 271 | ret = __pm_genpd_save_device(dle, genpd); |
272 | if (ret) | 272 | if (ret) { |
273 | goto err_dev; | 273 | genpd_set_active(genpd); |
274 | goto out; | ||
275 | } | ||
274 | 276 | ||
275 | if (genpd_abort_poweroff(genpd)) | 277 | if (genpd_abort_poweroff(genpd)) |
276 | goto out; | 278 | goto out; |
@@ -311,13 +313,6 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd) | |||
311 | genpd->poweroff_task = NULL; | 313 | genpd->poweroff_task = NULL; |
312 | wake_up_all(&genpd->status_wait_queue); | 314 | wake_up_all(&genpd->status_wait_queue); |
313 | return ret; | 315 | return ret; |
314 | |||
315 | err_dev: | ||
316 | list_for_each_entry_continue(dle, &genpd->dev_list, node) | ||
317 | __pm_genpd_restore_device(dle, genpd); | ||
318 | |||
319 | genpd_set_active(genpd); | ||
320 | goto out; | ||
321 | } | 316 | } |
322 | 317 | ||
323 | /** | 318 | /** |