mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] gpiolib: use dev_err when gpiod_configure_flags failed
@ 2024-03-15  1:10 Peng Fan (OSS)
  2024-03-15 11:12 ` Andy Shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Peng Fan (OSS) @ 2024-03-15  1:10 UTC (permalink / raw)
  To: linus.walleij, brgl, andy; +Cc: linux-gpio, linux-kernel, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Using dev_err to show error message will make life easier.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 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 ce94e37bcbee..37fe9db0bd74 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -4233,7 +4233,7 @@ struct gpio_desc *gpiod_find_and_request(struct device *consumer,
 
 	ret = gpiod_configure_flags(desc, con_id, lookupflags, flags);
 	if (ret < 0) {
-		dev_dbg(consumer, "setup of GPIO %s failed\n", con_id);
+		dev_err(consumer, "setup of GPIO %s failed: %d\n", con_id, ret);
 		gpiod_put(desc);
 		return ERR_PTR(ret);
 	}
-- 
2.37.1


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

* Re: [PATCH] gpiolib: use dev_err when gpiod_configure_flags failed
  2024-03-15  1:10 [PATCH] gpiolib: use dev_err when gpiod_configure_flags failed Peng Fan (OSS)
@ 2024-03-15 11:12 ` Andy Shevchenko
  2024-03-18  2:03   ` Peng Fan
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2024-03-15 11:12 UTC (permalink / raw)
  To: Peng Fan (OSS)
  Cc: linus.walleij, brgl, andy, linux-gpio, linux-kernel, Peng Fan

On Fri, Mar 15, 2024 at 3:02 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
>
> From: Peng Fan <peng.fan@nxp.com>
>
> Using dev_err to show error message will make life easier.

dev_err()

an error

...

It's unclear what the use case is and how this does make life easier.
We need to know more!

-- 
With Best Regards,
Andy Shevchenko

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

* RE: [PATCH] gpiolib: use dev_err when gpiod_configure_flags failed
  2024-03-15 11:12 ` Andy Shevchenko
@ 2024-03-18  2:03   ` Peng Fan
  2024-03-18 10:25     ` Andy Shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Peng Fan @ 2024-03-18  2:03 UTC (permalink / raw)
  To: Andy Shevchenko, Peng Fan (OSS)
  Cc: linus.walleij, brgl, andy, linux-gpio, linux-kernel

> Subject: Re: [PATCH] gpiolib: use dev_err when gpiod_configure_flags failed
> 
> On Fri, Mar 15, 2024 at 3:02 AM Peng Fan (OSS) <peng.fan@oss.nxp.com>
> wrote:
> >
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > Using dev_err to show error message will make life easier.
> 
> dev_err()
> 
> an error
> 
> ...
> 
> It's unclear what the use case is and how this does make life easier.
> We need to know more!

I forgot to add gpio-ranges in gpio node, then it always fail in my driver
probe to configure pinctrl. So if using dev_err(), it will be easier for
me to locate the error point.

Thanks,
Peng.

> 
> --
> With Best Regards,
> Andy Shevchenko

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

* Re: [PATCH] gpiolib: use dev_err when gpiod_configure_flags failed
  2024-03-18  2:03   ` Peng Fan
@ 2024-03-18 10:25     ` Andy Shevchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2024-03-18 10:25 UTC (permalink / raw)
  To: Peng Fan; +Cc: Peng Fan (OSS), linus.walleij, brgl, linux-gpio, linux-kernel

On Mon, Mar 18, 2024 at 02:03:12AM +0000, Peng Fan wrote:
> > Subject: Re: [PATCH] gpiolib: use dev_err when gpiod_configure_flags failed
> > On Fri, Mar 15, 2024 at 3:02 AM Peng Fan (OSS) <peng.fan@oss.nxp.com>
> > wrote:

...

> > It's unclear what the use case is and how this does make life easier.
> > We need to know more!
> 
> I forgot to add gpio-ranges in gpio node, then it always fail in my driver
> probe to configure pinctrl. So if using dev_err(), it will be easier for
> me to locate the error point.

At least make sure something like the above is in the commit message of the
next version.

-- 
With Best Regards,
Andy Shevchenko



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

end of thread, other threads:[~2024-03-18 10:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-15  1:10 [PATCH] gpiolib: use dev_err when gpiod_configure_flags failed Peng Fan (OSS)
2024-03-15 11:12 ` Andy Shevchenko
2024-03-18  2:03   ` Peng Fan
2024-03-18 10:25     ` Andy Shevchenko

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®