Skip to content

Commit

Permalink
regulator: AXP20x: fix wrong call to of_find_node_by_name
Browse files Browse the repository at this point in the history
The of_find_node_by_name function will search for a DT node named
"regulators" after the provided np node, but will not ensure that this node
is a child of np.
This might result in retrieving a "regulators" node that is not related to
the axp20x PMIC.

Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
Acked-by: Carlo Caione <carlo@caione.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Boris BREZILLON authored and Mark Brown committed May 19, 2014
1 parent dfe7a1b commit a6016c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/regulator/axp20x-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ static int axp20x_regulator_parse_dt(struct platform_device *pdev)
if (!np)
return 0;

regulators = of_find_node_by_name(np, "regulators");
regulators = of_get_child_by_name(np, "regulators");
if (!regulators) {
dev_warn(&pdev->dev, "regulators node not found\n");
} else {
Expand Down

0 comments on commit a6016c5

Please sign in to comment.