[PATCH master 05/14] gpiolib: fix gpio label generation with gpiod_get

Ahmad Fatoum a.fatoum at pengutronix.de
Tue Apr 11 00:14:27 PDT 2023


Current mistaken use of con_id instead of _con_id, can lead to labels
being called regulator.of-<NULL>. Fix this, so the label becomes
regulator.of instead.

Fixes: 9fb2fa240d58 ("gpiolib: implement dev_gpiod_get_index")
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 drivers/gpio/gpiolib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 736279875856..6ec63b1119b5 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -583,7 +583,7 @@ int dev_gpiod_get_index(struct device *dev,
 	buf = NULL;
 
 	if (!label) {
-		if (con_id)
+		if (_con_id)
 			label = buf = basprintf("%s-%s", dev_name(dev), _con_id);
 		else
 			label = dev_name(dev);
-- 
2.39.2




More information about the barebox mailing list