Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3e27c79c authored by Viresh Kumar's avatar Viresh Kumar
Browse files

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: 5ed4cecd ("OPP: Pass OPP table to _of_add_opp_table_v{1|2}()")
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent bf21c6e4
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -579,9 +579,7 @@ 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;

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