diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2022-02-20 13:47:34 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-03-08 09:59:59 +0100 |
commit | 5e9120149025e75fc0f41f5f05be8a9ec1647192 (patch) | |
tree | 79e228ec14195dbb265843e22d9b588eca3b36ce /drivers/regulator | |
parent | 261c22952ee38a3764d395676558bad4ad3a6b5f (diff) | |
download | barebox-5e9120149025e75fc0f41f5f05be8a9ec1647192.tar.gz barebox-5e9120149025e75fc0f41f5f05be8a9ec1647192.tar.xz |
regulator: core: fall back to node name if no regulator-name property
So far, the regulator was created anyway, but attempting to print the
name by the regulator command just output a "<NULL>" string.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220220124736.3052502-23-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/core.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index b2e5f8caa2..997b986d5f 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -166,6 +166,8 @@ int of_regulator_register(struct regulator_dev *rd, struct device_node *node) rd->always_on = of_property_read_bool(node, "regulator-always-on"); name = of_get_property(node, "regulator-name", NULL); + if (!name) + name = node->name; ri = __regulator_register(rd, name); if (IS_ERR(ri)) |