diff options
-rw-r--r-- | drivers/base/power/domain.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 49fdd4002b9f..da1d52576ec9 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c | |||
@@ -339,19 +339,16 @@ static void __pm_genpd_restore_device(struct pm_domain_data *pdd, | |||
339 | { | 339 | { |
340 | struct generic_pm_domain_data *gpd_data = to_gpd_data(pdd); | 340 | struct generic_pm_domain_data *gpd_data = to_gpd_data(pdd); |
341 | struct device *dev = pdd->dev; | 341 | struct device *dev = pdd->dev; |
342 | bool need_restore = gpd_data->need_restore; | ||
342 | 343 | ||
343 | if (!gpd_data->need_restore) | 344 | gpd_data->need_restore = false; |
344 | return; | ||
345 | |||
346 | mutex_unlock(&genpd->lock); | 345 | mutex_unlock(&genpd->lock); |
347 | 346 | ||
348 | genpd_start_dev(genpd, dev); | 347 | genpd_start_dev(genpd, dev); |
349 | genpd_restore_dev(genpd, dev); | 348 | if (need_restore) |
350 | genpd_stop_dev(genpd, dev); | 349 | genpd_restore_dev(genpd, dev); |
351 | 350 | ||
352 | mutex_lock(&genpd->lock); | 351 | mutex_lock(&genpd->lock); |
353 | |||
354 | gpd_data->need_restore = false; | ||
355 | } | 352 | } |
356 | 353 | ||
357 | /** | 354 | /** |
@@ -595,7 +592,7 @@ static int pm_genpd_runtime_resume(struct device *dev) | |||
595 | 592 | ||
596 | /* If power.irq_safe, the PM domain is never powered off. */ | 593 | /* If power.irq_safe, the PM domain is never powered off. */ |
597 | if (dev->power.irq_safe) | 594 | if (dev->power.irq_safe) |
598 | goto out; | 595 | return genpd_start_dev(genpd, dev); |
599 | 596 | ||
600 | mutex_lock(&genpd->lock); | 597 | mutex_lock(&genpd->lock); |
601 | ret = __pm_genpd_poweron(genpd); | 598 | ret = __pm_genpd_poweron(genpd); |
@@ -628,9 +625,6 @@ static int pm_genpd_runtime_resume(struct device *dev) | |||
628 | wake_up_all(&genpd->status_wait_queue); | 625 | wake_up_all(&genpd->status_wait_queue); |
629 | mutex_unlock(&genpd->lock); | 626 | mutex_unlock(&genpd->lock); |
630 | 627 | ||
631 | out: | ||
632 | genpd_start_dev(genpd, dev); | ||
633 | |||
634 | return 0; | 628 | return 0; |
635 | } | 629 | } |
636 | 630 | ||