diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2022-06-10 08:02:50 +0300 |
---|---|---|
committer | Viresh Kumar <viresh.kumar@linaro.org> | 2022-07-08 08:57:51 +0300 |
commit | 8bdac14b0cd56d9578d3112375ed8b23884c1a69 (patch) | |
tree | 83bbc602c3b1f0f47333a5c6becc60852467ac54 /drivers/opp/of.c | |
parent | 4768914bffdb0b2b023d9b1c5c4e596bf8332137 (diff) | |
download | linux-8bdac14b0cd56d9578d3112375ed8b23884c1a69.tar.xz |
OPP: Reuse _opp_compare_key() in _opp_add_static_v2()
Reuse _opp_compare_key() in _opp_add_static_v2() instead of just
comparing frequency while finding suspend frequency. Also add a comment
over _opp_compare_key() explaining its return values.
Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/opp/of.c')
-rw-r--r-- | drivers/opp/of.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/opp/of.c b/drivers/opp/of.c index bec9644a7260..bb49057cb1fc 100644 --- a/drivers/opp/of.c +++ b/drivers/opp/of.c @@ -929,8 +929,8 @@ static struct dev_pm_opp *_opp_add_static_v2(struct opp_table *opp_table, /* OPP to select on device suspend */ if (of_property_read_bool(np, "opp-suspend")) { if (opp_table->suspend_opp) { - /* Pick the OPP with higher rate as suspend OPP */ - if (new_opp->rate > opp_table->suspend_opp->rate) { + /* Pick the OPP with higher rate/bw/level as suspend OPP */ + if (_opp_compare_key(new_opp, opp_table->suspend_opp) == 1) { opp_table->suspend_opp->suspend = false; new_opp->suspend = true; opp_table->suspend_opp = new_opp; |