linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3] gpiolib: use dev_err() when gpiod_configure_flags failed
@ 2024-03-22  7:37 Peng Fan (OSS)
  2024-03-22 15:59 ` Andy Shevchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Peng Fan (OSS) @ 2024-03-22  7:37 UTC (permalink / raw)
  To: linus.walleij, brgl, andy; +Cc: linux-gpio, linux-kernel, Peng Fan

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

When gpio-ranges property was missed to be added in the gpio node,
using dev_err() to show an error message will helping to locate issues
easier.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---

V3:
 Move gpiod_put before dev_err per Andy Shevchenko
V2:
 Update commit log

 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..b988704f5d63 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -4233,8 +4233,8 @@ 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);
 		gpiod_put(desc);
+		dev_err(consumer, "setup of GPIO %s failed: %d\n", con_id, ret);
 		return ERR_PTR(ret);
 	}
 
-- 
2.37.1


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

* Re: [PATCH V3] gpiolib: use dev_err() when gpiod_configure_flags failed
  2024-03-22  7:37 [PATCH V3] gpiolib: use dev_err() when gpiod_configure_flags failed Peng Fan (OSS)
@ 2024-03-22 15:59 ` Andy Shevchenko
  2024-03-25 15:48   ` Bartosz Golaszewski
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2024-03-22 15:59 UTC (permalink / raw)
  To: Peng Fan (OSS)
  Cc: linus.walleij, brgl, andy, linux-gpio, linux-kernel, Peng Fan

On Fri, Mar 22, 2024 at 9:29 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
>
> From: Peng Fan <peng.fan@nxp.com>
>
> When gpio-ranges property was missed to be added in the gpio node,
> using dev_err() to show an error message will helping to locate issues
> easier.

Bart, are you aware that this will add yet another possibility of
scary '(null)' in the error level, which is much likely visible to the
end users?

I propose to apply my fix first to avoid this happening.
20240320165930.1182653-1-andriy.shevchenko@linux.intel.com

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH V3] gpiolib: use dev_err() when gpiod_configure_flags failed
  2024-03-22 15:59 ` Andy Shevchenko
@ 2024-03-25 15:48   ` Bartosz Golaszewski
  2024-03-25 16:00     ` Andy Shevchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Bartosz Golaszewski @ 2024-03-25 15:48 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Peng Fan (OSS), linus.walleij, andy, linux-gpio, linux-kernel, Peng Fan

On Fri, Mar 22, 2024 at 4:59 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
>
> On Fri, Mar 22, 2024 at 9:29 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
> >
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > When gpio-ranges property was missed to be added in the gpio node,
> > using dev_err() to show an error message will helping to locate issues
> > easier.
>
> Bart, are you aware that this will add yet another possibility of
> scary '(null)' in the error level, which is much likely visible to the
> end users?
>
> I propose to apply my fix first to avoid this happening.
> 20240320165930.1182653-1-andriy.shevchenko@linux.intel.com
>

I think you meant the v2[1]?

And sure, I will pick it up shortly.

Bart

[1] https://lore.kernel.org/lkml/20240320165930.1182653-1-andriy.shevchenko@linux.intel.com/T/

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

* Re: [PATCH V3] gpiolib: use dev_err() when gpiod_configure_flags failed
  2024-03-25 15:48   ` Bartosz Golaszewski
@ 2024-03-25 16:00     ` Andy Shevchenko
  2024-03-25 16:24       ` Bartosz Golaszewski
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2024-03-25 16:00 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Peng Fan (OSS), linus.walleij, linux-gpio, linux-kernel, Peng Fan

On Mon, Mar 25, 2024 at 04:48:27PM +0100, Bartosz Golaszewski wrote:
> On Fri, Mar 22, 2024 at 4:59 PM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
> > On Fri, Mar 22, 2024 at 9:29 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:

...

> > Bart, are you aware that this will add yet another possibility of
> > scary '(null)' in the error level, which is much likely visible to the
> > end users?
> >
> > I propose to apply my fix first to avoid this happening.
> > 20240320165930.1182653-1-andriy.shevchenko@linux.intel.com
> 
> I think you meant the v2[1]?

Yes!

> And sure, I will pick it up shortly.

Thank you!

> [1] https://lore.kernel.org/lkml/20240320165930.1182653-1-andriy.shevchenko@linux.intel.com/T/

I can update this patch (rebase it on top) if needed to make less burden on
the author's shoulders. Just tell me.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH V3] gpiolib: use dev_err() when gpiod_configure_flags failed
  2024-03-25 16:00     ` Andy Shevchenko
@ 2024-03-25 16:24       ` Bartosz Golaszewski
  2024-03-25 17:19         ` Andy Shevchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Bartosz Golaszewski @ 2024-03-25 16:24 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Peng Fan (OSS), linus.walleij, linux-gpio, linux-kernel, Peng Fan

On Mon, Mar 25, 2024 at 5:00 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
>
> On Mon, Mar 25, 2024 at 04:48:27PM +0100, Bartosz Golaszewski wrote:
> > On Fri, Mar 22, 2024 at 4:59 PM Andy Shevchenko
> > <andy.shevchenko@gmail.com> wrote:
> > > On Fri, Mar 22, 2024 at 9:29 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
>
> ...
>
> > > Bart, are you aware that this will add yet another possibility of
> > > scary '(null)' in the error level, which is much likely visible to the
> > > end users?
> > >
> > > I propose to apply my fix first to avoid this happening.
> > > 20240320165930.1182653-1-andriy.shevchenko@linux.intel.com
> >
> > I think you meant the v2[1]?
>
> Yes!
>
> > And sure, I will pick it up shortly.
>
> Thank you!
>
> > [1] https://lore.kernel.org/lkml/20240320165930.1182653-1-andriy.shevchenko@linux.intel.com/T/
>
> I can update this patch (rebase it on top) if needed to make less burden on
> the author's shoulders. Just tell me.
>

Sure, if you can resend both yours and this one then even better.

Bart

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

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

* Re: [PATCH V3] gpiolib: use dev_err() when gpiod_configure_flags failed
  2024-03-25 16:24       ` Bartosz Golaszewski
@ 2024-03-25 17:19         ` Andy Shevchenko
  0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2024-03-25 17:19 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Peng Fan (OSS), linus.walleij, linux-gpio, linux-kernel, Peng Fan

On Mon, Mar 25, 2024 at 6:24 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> On Mon, Mar 25, 2024 at 5:00 PM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
> > On Mon, Mar 25, 2024 at 04:48:27PM +0100, Bartosz Golaszewski wrote:
> > > On Fri, Mar 22, 2024 at 4:59 PM Andy Shevchenko
> > > <andy.shevchenko@gmail.com> wrote:
> > > > On Fri, Mar 22, 2024 at 9:29 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:

...

> > > > Bart, are you aware that this will add yet another possibility of
> > > > scary '(null)' in the error level, which is much likely visible to the
> > > > end users?
> > > >
> > > > I propose to apply my fix first to avoid this happening.
> > > > 20240320165930.1182653-1-andriy.shevchenko@linux.intel.com
> > >
> > > I think you meant the v2[1]?
> >
> > Yes!
> >
> > > And sure, I will pick it up shortly.
> >
> > Thank you!
> >
> > > [1] https://lore.kernel.org/lkml/20240320165930.1182653-1-andriy.shevchenko@linux.intel.com/T/
> >
> > I can update this patch (rebase it on top) if needed to make less burden on
> > the author's shoulders. Just tell me.
>
> Sure, if you can resend both yours and this one then even better.

Just sent both as v4.

-- 
With Best Regards,
Andy Shevchenko

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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-22  7:37 [PATCH V3] gpiolib: use dev_err() when gpiod_configure_flags failed Peng Fan (OSS)
2024-03-22 15:59 ` Andy Shevchenko
2024-03-25 15:48   ` Bartosz Golaszewski
2024-03-25 16:00     ` Andy Shevchenko
2024-03-25 16:24       ` Bartosz Golaszewski
2024-03-25 17:19         ` Andy Shevchenko

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).