lkml.org 
[lkml]   [2024]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V2] gpiolib: use dev_err() when gpiod_configure_flags failed
On Wed, Mar 20, 2024 at 11:07:40AM +0000, Peng Fan wrote:
> > On Wed, Mar 20, 2024 at 9:25 AM Peng Fan (OSS) <peng.fan@oss.nxp.com>
> > wrote:

..

> > > 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.
> >
> > I'm not convinced, so not my call to approve / reject, but see a remark below.
>
> You mean dev_err not help or else?

Moving it to error level.
Usually developers enable CONFIG_DEBUG_GPIO for these messages to appear.

..

> > > 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);
> >
> > While at it, can you move it to be after the gpiod_put()?
>
> Does it matter?

Yes, the system gives resource back as soon as possible.

--
With Best Regards,
Andy Shevchenko



\
 
 \ /
  Last update: 2024-05-27 15:55    [W:0.038 / U:1.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site