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

regulator: AXP20x: fix wrong call to of_find_node_by_name

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>

authored by

Boris BREZILLON and committed by
Mark Brown
a6016c52 dfe7a1b0

+1 -1
+1 -1
drivers/regulator/axp20x-regulator.c
··· 188 188 if (!np) 189 189 return 0; 190 190 191 - regulators = of_find_node_by_name(np, "regulators"); 191 + regulators = of_get_child_by_name(np, "regulators"); 192 192 if (!regulators) { 193 193 dev_warn(&pdev->dev, "regulators node not found\n"); 194 194 } else {