Thread (4 messages) 4 messages, 3 authors, 2025-09-25

[PATCH] Input: gpio-keys - fix misleading GPIO number

flat view
STALE378d

From: Wei <hidden>
Date: 2025-09-24 06:49:12
Also in: lkml
Subsystem: input (keyboard, mouse, joystick, touchscreen) drivers, the rest · Maintainers: Dmitry Torokhov, Linus Torvalds

From: Wei Liu <redacted>

The error log prints button->gpio, which is unset and default to 0
in non-legacy configurations, leading to misleading messages.

Use desc_to_gpio() to report the actual global GPIO number.

Signed-off-by: Wei Liu <redacted>
---
 drivers/input/keyboard/gpio_keys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index f9db86da0818..243295a3ea1d 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -584,7 +584,7 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
 				error = irq;
 				dev_err_probe(dev, error,
 					      "Unable to get irq number for GPIO %d\n",
-					      button->gpio);
+					      desc_to_gpio(bdata->gpiod));
 				return error;
 			}
 			bdata->irq = irq;
-- 
2.34.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help