diff options
author | Peng Fan <Peng.Fan@freescale.com> | 2015-08-07 16:43:42 +0800 |
---|---|---|
committer | Przemyslaw Marczak <p.marczak@samsung.com> | 2015-08-12 10:02:59 +0200 |
commit | cf2600111dfc83e921e3ba40f3cb187163165828 (patch) | |
tree | 2f9d7a1f68d653b2d3d724507243ce9b82c806a4 | |
parent | 430abe1cd721aacc6a715f5e8b9192ea6bee96fc (diff) | |
download | blackbird-obmc-uboot-cf2600111dfc83e921e3ba40f3cb187163165828.tar.gz blackbird-obmc-uboot-cf2600111dfc83e921e3ba40f3cb187163165828.zip |
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>
-rw-r--r-- | drivers/power/regulator/regulator-uclass.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c index f3fe7a55e1..a5170df916 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)) |