mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wei <wei.liu@oss.qualcomm.com>
To: dmitry.torokhov@gmail.com
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	gatien.chevallier@foss.st.com, linus.walleij@linaro.org,
	namcao@linutronix.de, zhiqiang.tu@oss.qualcomm.com
Subject: [PATCH] Input: gpio-keys - fix misleading GPIO number
Date: Wed, 24 Sep 2025 12:19:05 +0530	[thread overview]
Message-ID: <20250924064905.276174-1-wei.liu@oss.qualcomm.com> (raw)

From: Wei Liu <wei.liu@oss.qualcomm.com>

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 <wei.liu@oss.qualcomm.com>
---
 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


             reply	other threads:[~2025-09-24  6:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-24  6:49 Wei [this message]
2025-09-24 10:25 ` Linus Walleij
2025-09-25  0:07   ` Dmitry Torokhov
2025-09-25  8:39     ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250924064905.276174-1-wei.liu@oss.qualcomm.com \
    --to=wei.liu@oss.qualcomm.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gatien.chevallier@foss.st.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namcao@linutronix.de \
    --cc=zhiqiang.tu@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®