* [PATCH] regulator: of_get_regulation_constraints: Use node name as fallback
@ 2013-09-22 10:47 Lars-Peter Clausen
2013-09-23 10:15 ` Mark Brown
0 siblings, 1 reply; 4+ messages in thread
From: Lars-Peter Clausen @ 2013-09-22 10:47 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood; +Cc: linux-kernel, Lars-Peter Clausen
If the "regulator-name" property is not present use the name of the devicetree
node as a fallback.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
drivers/regulator/of_regulator.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
index 7827384..53a83e8 100644
--- a/drivers/regulator/of_regulator.c
+++ b/drivers/regulator/of_regulator.c
@@ -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)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] regulator: of_get_regulation_constraints: Use node name as fallback
2013-09-22 10:47 [PATCH] regulator: of_get_regulation_constraints: Use node name as fallback Lars-Peter Clausen
@ 2013-09-23 10:15 ` Mark Brown
2013-09-23 20:28 ` Lars-Peter Clausen
0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2013-09-23 10:15 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: Liam Girdwood, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 319 bytes --]
On Sun, Sep 22, 2013 at 12:47:34PM +0200, Lars-Peter Clausen wrote:
> 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.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] regulator: of_get_regulation_constraints: Use node name as fallback
2013-09-23 10:15 ` Mark Brown
@ 2013-09-23 20:28 ` Lars-Peter Clausen
2013-09-23 23:33 ` Mark Brown
0 siblings, 1 reply; 4+ messages in thread
From: Lars-Peter Clausen @ 2013-09-23 20:28 UTC (permalink / raw)
To: Mark Brown; +Cc: Liam Girdwood, linux-kernel
On 09/23/2013 12:15 PM, Mark Brown wrote:
> On Sun, Sep 22, 2013 at 12:47:34PM +0200, Lars-Peter Clausen wrote:
>> 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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] regulator: of_get_regulation_constraints: Use node name as fallback
2013-09-23 20:28 ` Lars-Peter Clausen
@ 2013-09-23 23:33 ` Mark Brown
0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2013-09-23 23:33 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: Liam Girdwood, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 796 bytes --]
On Mon, Sep 23, 2013 at 10:28:27PM +0200, Lars-Peter Clausen wrote:
> On 09/23/2013 12:15 PM, Mark Brown wrote:
> >On Sun, Sep 22, 2013 at 12:47:34PM +0200, Lars-Peter Clausen wrote:
> >>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.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-09-23 23:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-22 10:47 [PATCH] regulator: of_get_regulation_constraints: Use node name as fallback Lars-Peter Clausen
2013-09-23 10:15 ` Mark Brown
2013-09-23 20:28 ` Lars-Peter Clausen
2013-09-23 23:33 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox