Skip to contentSkip to conversation

regulator: of_get_regulation_constraints: Use node name as fallback

PATCH In review Lars-Peter Clausen 2 participants 4 messages Sep 22, 2013 – Sep 23, 2013 Voltage and current regulator framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regulator: of_get_regulation_constraints: Use node name as fallback

If the "regulator-name" property is not present use the name of the devicetree node as a fallback.

---
 drivers/regulator/of_regulator.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/regulator/of_regulator.c +2 -0
index 7827384..53a83e8 100644
@@ -25,6 +25,8 @@ static void of_get_regulation_constraints(struct device_node *np,
 	struct regulation_constraints *constraints = &(*init_data)->constraints;
 
 	constraints->name = of_get_property(np, "regulator-name", NULL);
+	if (!constraints->name)
+		constraints->name = np->name;
 
 	min_uV = of_get_property(np, "regulator-min-microvolt", NULL);
 	if (min_uV)
Signature · 1 line
1.7.10.4
maintainer
#1 lore raw
Quoted 2 lines · Lars-Peter Clausen

If the "regulator-name" property is not present use the name of the devicetree node as a fallback.

You're not supposed to use the node name for anything, the goal is that it's entirely ornamental noise. Which is a bit annoying but there we are.

#2 lore raw
Quoted 8 lines · Mark Brown
Quoted 2 lines · Lars-Peter Clausen

If the "regulator-name" property is not present use the name of the devicetree node as a fallback.

You're not supposed to use the node name for anything, the goal is that it's entirely ornamental noise. Which is a bit annoying but there we are.

Is this documented somewhere? I'd be interested in the rationale behind this.

maintainer
#3 lore raw
Quoted 10 lines · Lars-Peter Clausen
Quoted 7 lines · Mark Brown
Quoted 2 lines · Lars-Peter Clausen

If the "regulator-name" property is not present use the name of the devicetree node as a fallback.

You're not supposed to use the node name for anything, the goal is that it's entirely ornamental noise. Which is a bit annoying but there we are.

Is this documented somewhere? I'd be interested in the rationale behind this.

I have no idea, I've not seen any documentation but that doesn't mean there isn't any. My understanding is that the goal is to allow it to be freely used by the DT author without consequence, though as you can probably tell I'm not personally 100% behind this idea.