lkml.org 
[lkml]   [2023]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] gpio: sim: don't fiddle with GPIOLIB private members
On Tue, Sep 05, 2023 at 02:10:38PM +0200, Bartosz Golaszewski wrote:
> On Tue, Sep 5, 2023 at 2:09 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > On Tue, Sep 05, 2023 at 03:05:17PM +0300, Andy Shevchenko wrote:
> > > On Tue, Sep 05, 2023 at 10:24:13AM +0200, Bartosz Golaszewski wrote:

...

> > > > + chip->swnode = swnode;
> > > > + ret = device_for_each_child(dev, chip, gpio_sim_chip_set_device);
> > > > + if (!ret)
> > > > + return -ENODEV;
> > >
> > > Can bus_find_device_by_fwnode() be used here?
> >
> > Answering to myself: you already mentioned that this should cover any bus,
> > so the answer is "no".
>
> I think I mentioned it under the gpio-consumer where it's true. Here
> we are sure it's on the platform bus.

Then bus_find_device_by_fwnode() can be used here, no?

> > But also we have device_find_child() if I understood the purpose of the above
> > it should suit better, no?
>
> Right, it's a better match.

In either case be careful about reference counting on the returned dev.

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2023-09-05 18:48    [W:0.136 / U:0.860 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site