Skip to content

Commit

Permalink
OPP: Fix parsing of multiple phandles in "operating-points-v2" property
Browse files Browse the repository at this point in the history
We currently return error if more than one phandle is present in the
"operating-points-v2" property, which is incorrect. We only want to
check the count of phandles here and set index to 0 if only one phandle
is present.

Fix it.

Fixes: 5ed4cec ("OPP: Pass OPP table to _of_add_opp_table_v{1|2}()")
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
  • Loading branch information
Viresh Kumar committed Nov 23, 2018
1 parent bf21c6e commit 3e27c79
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/opp/of.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,10 +579,8 @@ int dev_pm_opp_of_add_table_indexed(struct device *dev, int index)
*/
count = of_count_phandle_with_args(dev->of_node,
"operating-points-v2", NULL);
if (count != 1)
return -ENODEV;

index = 0;
if (count == 1)
index = 0;
}

opp_table = dev_pm_opp_get_opp_table_indexed(dev, index);
Expand Down

0 comments on commit 3e27c79

Please sign in to comment.