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>
This commit is contained in:
Родитель
54eeddbf92
Коммит
624c8df7d2
|
@ -730,14 +730,11 @@ static int pm_genpd_prepare(struct device *dev)
|
||||||
* at this point and a system wakeup event should be reported if it's
|
* at this point and a system wakeup event should be reported if it's
|
||||||
* set up to wake up the system from sleep states.
|
* set up to wake up the system from sleep states.
|
||||||
*/
|
*/
|
||||||
pm_runtime_get_noresume(dev);
|
|
||||||
if (pm_runtime_barrier(dev) && device_may_wakeup(dev))
|
if (pm_runtime_barrier(dev) && device_may_wakeup(dev))
|
||||||
pm_wakeup_event(dev, 0);
|
pm_wakeup_event(dev, 0);
|
||||||
|
|
||||||
if (pm_wakeup_pending()) {
|
if (pm_wakeup_pending())
|
||||||
pm_runtime_put(dev);
|
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
|
||||||
|
|
||||||
if (resume_needed(dev, genpd))
|
if (resume_needed(dev, genpd))
|
||||||
pm_runtime_resume(dev);
|
pm_runtime_resume(dev);
|
||||||
|
@ -751,10 +748,8 @@ static int pm_genpd_prepare(struct device *dev)
|
||||||
|
|
||||||
mutex_unlock(&genpd->lock);
|
mutex_unlock(&genpd->lock);
|
||||||
|
|
||||||
if (genpd->suspend_power_off) {
|
if (genpd->suspend_power_off)
|
||||||
pm_runtime_put_noidle(dev);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The PM domain must be in the GPD_STATE_ACTIVE state at this point,
|
* 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)
|
||||||
pm_runtime_enable(dev);
|
pm_runtime_enable(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
pm_runtime_put(dev);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче