lkml.org 
[lkml]   [2013]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] regulator: of_get_regulation_constraints: Use node name as fallback
Date
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


\
 
 \ /
  Last update: 2013-09-22 13:41    [W:0.071 / U:1.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site