[PATCH v5 1/6] gpiolib: Introduce a helper to get first GPIO controller node

Bartosz Golaszewski brgl at bgdev.pl
Thu May 5 06:05:52 PDT 2022


On Tue, Apr 26, 2022 at 12:29 PM Andy Shevchenko
<andy.shevchenko at gmail.com> wrote:
>
> On Tue, Apr 26, 2022 at 12:27 AM Bartosz Golaszewski <brgl at bgdev.pl> wrote:
> >
> > On Thu, Apr 14, 2022 at 9:02 PM Andy Shevchenko
> > <andriy.shevchenko at linux.intel.com> wrote:
> > >
> > > Introduce a helper to get first GPIO controller node which drivers
> > > may want to use.
>
> > > +static inline struct fwnode_handle *gpiochip_node_get_first(struct device *dev)
> > > +{
> > > +       struct fwnode_handle *fwnode;
> > > +
> > > +       for_each_gpiochip_node(dev, fwnode)
> > > +               return fwnode;
> > > +
> > > +       return NULL;
> > > +}
> > > +
> > >  #endif /* __LINUX_GPIO_DRIVER_H */
> > > --
> > > 2.35.1
> > >
> >
> > Any chance you could name it get_first_gpiochip_node()? It's static so
> > we don't have to worry about the prefix and it would make the purpose
> > more clear.
>
> There are two things why I prefer it as is:
> 1) it's static inline, so it's part of (internal) but still exported API;
> 2) it's already in my for-next branch which I would like not to
> rebase, until it's a really serious issue.
>
> That said, if you still insist I can rename it.

No that's fine and I also pulled that into my tree.

Bart



More information about the linux-amlogic mailing list