Thread (14 messages) 14 messages, 2 authors, 2014-09-15

[PATCH 2/5] regulator: fan53555: set regulator name from constraints name

flat view
STALE4404d

From: Heiko Stuebner <heiko@sntech.de>
Date: 2014-09-14 19:20:58
Also in: lkml
Subsystem: the rest, voltage and current regulator framework · Maintainers: Linus Torvalds, Liam Girdwood, Mark Brown

Revision v1 of 3 in this series.

Revisions (3)
  1. v1 current
  2. v2 [diff vs current]
  3. v3 [diff vs current]
There is a high potential of more than one of those regulators existing
on a board, so name the regulator according to the name provided in the
initdata instead of statically.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 drivers/regulator/fan53555.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
index c912ba7..d143790 100644
--- a/drivers/regulator/fan53555.c
+++ b/drivers/regulator/fan53555.c
@@ -206,7 +206,12 @@ static int fan53555_regulator_register(struct fan53555_device_info *di,
 {
 	struct regulator_desc *rdesc = &di->desc;
 
-	rdesc->name = "fan53555-reg";
+	rdesc->name = devm_kstrdup(di->dev,
+				   di->regulator->constraints.name,
+				   GFP_KERNEL);
+	if (!rdesc->name)
+		return -ENOMEM;
+
 	rdesc->supply_name = "vin";
 	rdesc->ops = &fan53555_regulator_ops;
 	rdesc->type = REGULATOR_VOLTAGE;
-- 
2.0.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help