From 5e9120149025e75fc0f41f5f05be8a9ec1647192 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Sun, 20 Feb 2022 13:47:34 +0100 Subject: 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 "" string. Signed-off-by: Ahmad Fatoum Link: https://lore.barebox.org/20220220124736.3052502-23-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer --- drivers/regulator/core.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/regulator/core.c') 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)) -- cgit v1.2.3