summaryrefslogtreecommitdiff
path: root/drivers/opp/core.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2023-02-22 16:36:37 +0530
committerViresh Kumar <viresh.kumar@linaro.org>2023-04-03 09:45:09 +0530
commit29b1a92e5e953214388ac1f3656cb3af266ca74f (patch)
tree1ae9ba85edaefb6d6aee6f8af5e0008d99728201 /drivers/opp/core.c
parente9eadc28271940266ace3f748a1c6278bd886ea8 (diff)
OPP: Handle all genpd cases together in _set_required_opps()
There is no real need of keeping separate code for single genpd case, it can be made to work with a simple change. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/opp/core.c')
-rw-r--r--drivers/opp/core.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/opp/core.c b/drivers/opp/core.c
index e87567dbe99f..6d7016ce8c53 100644
--- a/drivers/opp/core.c
+++ b/drivers/opp/core.c
@@ -959,7 +959,8 @@ static int _set_required_opps(struct device *dev,
struct dev_pm_opp *opp, bool up)
{
struct opp_table **required_opp_tables = opp_table->required_opp_tables;
- struct device **genpd_virt_devs = opp_table->genpd_virt_devs;
+ struct device **genpd_virt_devs =
+ opp_table->genpd_virt_devs ? opp_table->genpd_virt_devs : &dev;
int i, ret = 0;
if (!required_opp_tables)
@@ -979,12 +980,6 @@ static int _set_required_opps(struct device *dev,
return -ENOENT;
}
- /* Single genpd case */
- if (!genpd_virt_devs)
- return _set_required_opp(dev, dev, opp, 0);
-
- /* Multiple genpd case */
-
/*
* Acquire genpd_virt_dev_lock to make sure we don't use a genpd_dev
* after it is freed from another thread.