Skip to contentSkip to conversation

regulator: palmas: get regulators node from parent node only

PATCH Applied Laxman Dewangan 3 participants 3 messages Oct 3, 2013 – Oct 7, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regulator: palmas: get regulators node from parent node only

The device tree binding of Palmas regulator driver says as:

palmas_pmis {
	compatible = "ti,palmas-pmic";
	...
	regulators {
		...
	}
};

In this "regulators" subnode is expected to be part of parent node, not the outside of parent node. Hence to get the regulator node, the correct call is of_get_child_by_name() rather than of_find_node_by_name() which actually searches the "regulators" node from the parent node to end of DTS file.

---
The same issue exist on other drivers like tps65910, ts6586x, tps65090. I will post the patches once this is fine.

 drivers/regulator/palmas-regulator.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/regulator/palmas-regulator.c +1 -1
index 9d87c30..9c62b1d 100644
@@ -820,7 +820,7 @@ static void palmas_dt_to_pdata(struct device *dev,
 	int idx, ret;
 
 	node = of_node_get(node);
-	regulators = of_find_node_by_name(node, "regulators");
+	regulators = of_get_child_by_name(node, "regulators");
 	if (!regulators) {
 		dev_info(dev, "regulator node not found\n");
 		return;
Signature · 1 line
1.7.1.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Laxman Dewangan

The device tree binding of Palmas regulator driver says as:

palmas_pmis {
	compatible = "ti,palmas-pmic";
	...
	regulators {
		...
	}
};
Quoted 5 lines

In this "regulators" subnode is expected to be part of parent node, not the outside of parent node. Hence to get the regulator node, the correct call is of_get_child_by_name() rather than of_find_node_by_name() which actually searches the "regulators" node from the parent node to end of DTS file.