Skip to content

Commit 3e27c79

Browse files
committed
OPP: Fix parsing of multiple phandles in "operating-points-v2" property
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>
1 parent bf21c6e commit 3e27c79

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/opp/of.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -579,10 +579,8 @@ int dev_pm_opp_of_add_table_indexed(struct device *dev, int index)
579579
*/
580580
count = of_count_phandle_with_args(dev->of_node,
581581
"operating-points-v2", NULL);
582-
if (count != 1)
583-
return -ENODEV;
584-
585-
index = 0;
582+
if (count == 1)
583+
index = 0;
586584
}
587585

588586
opp_table = dev_pm_opp_get_opp_table_indexed(dev, index);

0 commit comments

Comments
 (0)