linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: gpio-keys - filter gpio_keys -EPROBE_DEFER error messages
@ 2023-12-29  1:36 Hermes Zhang
  2023-12-29  7:46 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Hermes Zhang @ 2023-12-29  1:36 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: kernel, Hermes Zhang, linux-input, linux-kernel

From: Hermes Zhang <chenhuiz@axis.com>

commit ae42f9288846 ("gpio: Return EPROBE_DEFER if gc->to_irq is NULL")
make gpiod_to_irq() possible to return -EPROBE_DEFER when the racing
happens. This causes the following error message to be printed:

    gpio-keys gpio_keys: Unable to get irq number for GPIO 0, error -517

Fix that by changing dev_err() to dev_err_probe()

Signed-off-by: Hermes Zhang <chenhuiz@axis.com>
---
 drivers/input/keyboard/gpio_keys.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 2e7c2c046e67..193856599669 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -581,9 +581,9 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
 			irq = gpiod_to_irq(bdata->gpiod);
 			if (irq < 0) {
 				error = irq;
-				dev_err(dev,
-					"Unable to get irq number for GPIO %d, error %d\n",
-					button->gpio, error);
+				dev_err_probe(dev, error,
+					      "Unable to get irq number for GPIO %d\n",
+					      button->gpio);
 				return error;
 			}
 			bdata->irq = irq;
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Input: gpio-keys - filter gpio_keys -EPROBE_DEFER error messages
  2023-12-29  1:36 [PATCH] Input: gpio-keys - filter gpio_keys -EPROBE_DEFER error messages Hermes Zhang
@ 2023-12-29  7:46 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2023-12-29  7:46 UTC (permalink / raw)
  To: Hermes Zhang; +Cc: kernel, Hermes Zhang, linux-input, linux-kernel

On Fri, Dec 29, 2023 at 09:36:57AM +0800, Hermes Zhang wrote:
> From: Hermes Zhang <chenhuiz@axis.com>
> 
> commit ae42f9288846 ("gpio: Return EPROBE_DEFER if gc->to_irq is NULL")
> make gpiod_to_irq() possible to return -EPROBE_DEFER when the racing
> happens. This causes the following error message to be printed:
> 
>     gpio-keys gpio_keys: Unable to get irq number for GPIO 0, error -517
> 
> Fix that by changing dev_err() to dev_err_probe()
> 
> Signed-off-by: Hermes Zhang <chenhuiz@axis.com>

Applied, thank you.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-29  7:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-29  1:36 [PATCH] Input: gpio-keys - filter gpio_keys -EPROBE_DEFER error messages Hermes Zhang
2023-12-29  7:46 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).