[PATCH 22/24] regulator: core: fall back to node name if no regulator-name property
Ahmad Fatoum
a.fatoum at pengutronix.de
Sun Feb 20 04:47:34 PST 2022
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 at pengutronix.de>
---
drivers/regulator/core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index b2e5f8caa2ca..997b986d5f07 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))
--
2.30.2
More information about the barebox
mailing list