]> git.itanic.dy.fi Git - linux-stable/commitdiff
soc: qcom: rpmhpd: Use corner in power_off
authorBjorn Andersson <bjorn.andersson@linaro.org>
Sat, 3 Jul 2021 00:54:15 +0000 (17:54 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Sep 2021 07:47:31 +0000 (09:47 +0200)
[ Upstream commit d43b3a989bc8c06fd4bbb69a7500d180db2d68e8 ]

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: 279b7e8a62cc ("soc: qcom: rpmhpd: Add RPMh power domain driver")
Reviewed-by: Rajendra Nayak <rnayak@codeaurora.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
Tested-by: Sibi Sankar <sibis@codeaurora.org>
Link: https://lore.kernel.org/r/20210703005416.2668319-2-bjorn.andersson@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/soc/qcom/rpmhpd.c

index 51850cc68b701e8e3f79b49f616d04bcd71c6e47..aa24237a78405d6f3a451b44e27aedcd3749cb80 100644 (file)
@@ -235,12 +235,11 @@ static int rpmhpd_power_on(struct generic_pm_domain *domain)
 static int rpmhpd_power_off(struct generic_pm_domain *domain)
 {
        struct rpmhpd *pd = domain_to_rpmhpd(domain);
-       int ret = 0;
+       int ret;
 
        mutex_lock(&rpmhpd_lock);
 
-       ret = rpmhpd_aggregate_corner(pd, pd->level[0]);
-
+       ret = rpmhpd_aggregate_corner(pd, 0);
        if (!ret)
                pd->enabled = false;