Currently, GPIOs claimed by this driver for external rail control
all show up with "s2mps11-regulator" as consumer, which is not
very informative.
Switch to using the regulator name via desc->name instead, using the
device name as fallback.
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
drivers/regulator/s2mps11.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c
index f19140e97b9d7a5e7c07cdc5e002de345aad32d9..3e9da15081e680d7660c60270af54ba2a4f8da1d 100644
--- a/drivers/regulator/s2mps11.c
+++ b/drivers/regulator/s2mps11.c
@@ -363,7 +363,8 @@ static int s2mps11_of_parse_gpiod(struct device_node *np,
ena_gpiod = fwnode_gpiod_get_index(of_fwnode_handle(np), con_id, 0,
GPIOD_OUT_HIGH |
GPIOD_FLAGS_BIT_NONEXCLUSIVE,
- "s2mps11-regulator");
+ desc->name
+ ? : dev_name(config->dev));
if (IS_ERR(ena_gpiod)) {
ret = PTR_ERR(ena_gpiod);
--
2.51.2.1041.gc1ab5b90ca-goog