Skip to content

Commit

Permalink
OPP: Handle all genpd cases together in _set_required_opps()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Ulf Hansson <[email protected]>
  • Loading branch information
vireshk committed Apr 3, 2023
1 parent e9eadc2 commit 29b1a92
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions drivers/opp/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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.
Expand Down

0 comments on commit 29b1a92

Please sign in to comment.