Commit d43b3a98 authored by Bjorn Andersson's avatar Bjorn Andersson

soc: qcom: rpmhpd: Use corner in power_off

rpmhpd_aggregate_corner() takes a corner as parameter, but in
rpmhpd_power_off() the code requests the level of the first corner
instead.

In all (known) current cases the first corner has level 0, so this
change should be a nop, but in case that there's a power domain with a
non-zero lowest level this makes sure that rpmhpd_power_off() actually
requests the lowest level - which is the closest to "power off" we can
get.

While touching the code, also skip the unnecessary zero-initialization
of "ret".

Fixes: 279b7e8a ("soc: qcom: rpmhpd: Add RPMh power domain driver")
Reviewed-by: default avatarRajendra Nayak <rnayak@codeaurora.org>
Reviewed-by: default avatarStephen Boyd <swboyd@chromium.org>
Reviewed-by: default avatarSibi Sankar <sibis@codeaurora.org>
Tested-by: default avatarSibi Sankar <sibis@codeaurora.org>
Link: https://lore.kernel.org/r/20210703005416.2668319-2-bjorn.andersson@linaro.orgSigned-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent d63486dd
...@@ -403,12 +403,11 @@ static int rpmhpd_power_on(struct generic_pm_domain *domain) ...@@ -403,12 +403,11 @@ static int rpmhpd_power_on(struct generic_pm_domain *domain)
static int rpmhpd_power_off(struct generic_pm_domain *domain) static int rpmhpd_power_off(struct generic_pm_domain *domain)
{ {
struct rpmhpd *pd = domain_to_rpmhpd(domain); struct rpmhpd *pd = domain_to_rpmhpd(domain);
int ret = 0; int ret;
mutex_lock(&rpmhpd_lock); mutex_lock(&rpmhpd_lock);
ret = rpmhpd_aggregate_corner(pd, pd->level[0]); ret = rpmhpd_aggregate_corner(pd, 0);
if (!ret) if (!ret)
pd->enabled = false; pd->enabled = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment