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

Andy Shevchenko andy.shevchenko at gmail.com
Tue Apr 26 03:29:20 PDT 2022


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.

-- 
With Best Regards,
Andy Shevchenko



More information about the linux-arm-kernel mailing list