aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPeng Fan2015-08-07 16:43:42 +0800
committerPrzemyslaw Marczak2015-08-12 10:02:59 +0200
commitcf2600111dfc83e921e3ba40f3cb187163165828 (patch)
tree2f9d7a1f68d653b2d3d724507243ce9b82c806a4 /drivers
parent430abe1cd721aacc6a715f5e8b9192ea6bee96fc (diff)
power: regulator use node name when no regulator-name
If there is no property named 'regulator-name' for regulators, choose node name instead, but not directly return failure value. Signed-off-by: Peng Fan <Peng.Fan@freescale.com> Cc: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/power/regulator/regulator-uclass.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c
index f3fe7a55e1b..a5170df9165 100644
--- a/drivers/power/regulator/regulator-uclass.c
+++ b/drivers/power/regulator/regulator-uclass.c
@@ -256,7 +256,9 @@ static int regulator_post_bind(struct udevice *dev)
if (!uc_pdata->name) {
debug("%s: dev: %s has no property 'regulator-name'\n",
__func__, dev->name);
- return -EINVAL;
+ uc_pdata->name = fdt_get_name(blob, offset, NULL);
+ if (!uc_pdata->name)
+ return -EINVAL;
}
if (regulator_name_is_unique(dev, uc_pdata->name))