regulator: of_get_regulation_constraints: Use node name as fallback
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
@@ -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
Mark Brown
maintainerQuoted 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.
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.
Mark Brown
maintainerQuoted 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.