lkml.org 
[lkml]   [2022]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v4 5/6] gpiolib: consolidate GPIO lookups
On Sun, Nov 13, 2022 at 2:07 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Fri, Nov 11, 2022 at 02:19:07PM -0800, Dmitry Torokhov wrote:
> > Ensure that all paths to obtain/look up GPIOD from generic
> > consumer-visible APIs go through the new gpiod_find_and_request()
> > helper, so that we can easily extend it with support for new firmware
> > mechanisms.
> >
> > The only exception is OF-specific [devm_]gpiod_get_from_of_node() API
> > that is still being used by a couple of drivers and will be removed as
> > soon as patches converting them to use generic fwnode/device APIs are
> > accepted.
>
> ...
>
> > +static struct gpio_desc *gpiod_find_and_request(struct device *consumer,
> > + struct fwnode_handle *fwnode,
> > + const char *con_id,
> > + unsigned int idx,
> > + enum gpiod_flags flags,
> > + const char *label,
> > + bool platform_lookup_allowed)
> > +{
> > + struct gpio_desc *desc = ERR_PTR(-ENOENT);
> > + unsigned long lookupflags;
> > + int ret;
>
> > + if (!IS_ERR_OR_NULL(fwnode))
>
> Just for the record. I haven't given my tag to this patch, because I think that
> the above check (and respective assignment above) are redundant. Even comment
> inside the below condition clarifies the point of the meaning of descriptor
> being not found. Besides that many of device property APIs designed the way
> that input fwnode can be invalid.
>
> Nevertheless, we agreed with Dmitry that this disagreement should be solved on
> maintainer's level, while it doesn't affect code functionality.
>
> The rest of the patch is fine.
>

Noted. :)

I'm fine with Dmitry's explanation. It doesn't hurt so let's go with
the author's intention.

Bart

\
 
 \ /
  Last update: 2022-11-15 11:28    [W:0.466 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site