regulator: fan53555: set regulator name from constraints

A patch from »regulator: add support for syr82x to fan53555« in state Mainline for linux-kernel

From: Heiko Stuebner <heiko@...> Date: Sun, 14 Sep 2014 14:06:51 +0200

Commit-Message

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@...>

Patch-Comment

drivers/regulator/fan53555.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)

Statistics

  • 6 lines added
  • 1 lines removed

Changes

------------------------- drivers/regulator/fan53555.c -------------------------
index c912ba7..d143790 100644
@@ -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;
 
 

Recent Patches

About Us

Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum vel, tempor at, varius non, purus. Mauris vitae nisl nec metus placerat consectetuer.

Read More...