Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 5ed4cecd75e9 ("OPP: Pass OPP table to _of_add_opp_table_v{1|2}()")
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

+2 -4
+2 -4
drivers/opp/of.c
··· 579 579 */ 580 580 count = of_count_phandle_with_args(dev->of_node, 581 581 "operating-points-v2", NULL); 582 - if (count != 1) 583 - return -ENODEV; 584 - 585 - index = 0; 582 + if (count == 1) 583 + index = 0; 586 584 } 587 585 588 586 opp_table = dev_pm_opp_get_opp_table_indexed(dev, index);