diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2016-04-26 02:47:17 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-04-26 16:27:07 -0400 |
commit | 624c8df7d2823ec0df9609025480309322886ed3 (patch) | |
tree | e51ec6c10a04fd8ed8fd13ea74eff41cb2e57253 | |
parent | 54eeddbf92d0de297d78f7419dde00079d553dec (diff) |
PM / Domains: Remove redundant pm_runtime_get|put*() in pm_genpd_prepare()
The PM core increases and decreases the runtime PM usage count in the
system PM prepare phase. This makes some of the pm_runtime_get|put*()
calls in pm_genpd_prepare() redundant, so let's remove them.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/base/power/domain.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 4ce4ce0a2730..60a357386705 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c | |||
@@ -730,14 +730,11 @@ static int pm_genpd_prepare(struct device *dev) | |||
730 | * at this point and a system wakeup event should be reported if it's | 730 | * at this point and a system wakeup event should be reported if it's |
731 | * set up to wake up the system from sleep states. | 731 | * set up to wake up the system from sleep states. |
732 | */ | 732 | */ |
733 | pm_runtime_get_noresume(dev); | ||
734 | if (pm_runtime_barrier(dev) && device_may_wakeup(dev)) | 733 | if (pm_runtime_barrier(dev) && device_may_wakeup(dev)) |
735 | pm_wakeup_event(dev, 0); | 734 | pm_wakeup_event(dev, 0); |
736 | 735 | ||
737 | if (pm_wakeup_pending()) { | 736 | if (pm_wakeup_pending()) |
738 | pm_runtime_put(dev); | ||
739 | return -EBUSY; | 737 | return -EBUSY; |
740 | } | ||
741 | 738 | ||
742 | if (resume_needed(dev, genpd)) | 739 | if (resume_needed(dev, genpd)) |
743 | pm_runtime_resume(dev); | 740 | pm_runtime_resume(dev); |
@@ -751,10 +748,8 @@ static int pm_genpd_prepare(struct device *dev) | |||
751 | 748 | ||
752 | mutex_unlock(&genpd->lock); | 749 | mutex_unlock(&genpd->lock); |
753 | 750 | ||
754 | if (genpd->suspend_power_off) { | 751 | if (genpd->suspend_power_off) |
755 | pm_runtime_put_noidle(dev); | ||
756 | return 0; | 752 | return 0; |
757 | } | ||
758 | 753 | ||
759 | /* | 754 | /* |
760 | * The PM domain must be in the GPD_STATE_ACTIVE state at this point, | 755 | * The PM domain must be in the GPD_STATE_ACTIVE state at this point, |
@@ -776,7 +771,6 @@ static int pm_genpd_prepare(struct device *dev) | |||
776 | pm_runtime_enable(dev); | 771 | pm_runtime_enable(dev); |
777 | } | 772 | } |
778 | 773 | ||
779 | pm_runtime_put(dev); | ||
780 | return ret; | 774 | return ret; |
781 | } | 775 | } |
782 | 776 | ||