提交 a6016c52 编写于 作者: B Boris BREZILLON 提交者: Mark Brown

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: NBoris BREZILLON <boris.brezillon@free-electrons.com>
Acked-by: NCarlo Caione <carlo@caione.org>
Signed-off-by: NMark Brown <broonie@linaro.org>
上级 dfe7a1b0
......@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册