lkml.org 
[lkml]   [2021]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v12 3/7] gpiolib: of: make fwnode take precedence in struct gpio_chip
On Fri, Dec 03, 2021 at 08:51:56PM +0200, Andy Shevchenko wrote:
> On Fri, Dec 03, 2021 at 02:29:59PM +0100, Bartosz Golaszewski wrote:

...

> > if (gc->parent)
> > gdev->dev.of_node = gc->parent->of_node;
> >
> > + if (gc->fwnode)
> > + gc->of_node = to_of_node(gc->fwnode);
> > +
> > /* If the gpiochip has an assigned OF node this takes precedence */
> > if (gc->of_node)
> > gdev->dev.of_node = gc->of_node;
>
> Similar should be done in acpi_gpio_dev_init():
>
> if (gc->fwnode)
> device_set_node(&gdev->dev, gc->fwnode);

Hmm... On the second though this should be rather

if (gc->fwnode)
set_secondary_fwnode(&gdev->dev, gc->fwnode);

So the logic will be that:
- if we have parent, set primary fwnode to it
- if we have fwnode, set secondary one to it
- otherwise do nothing

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2021-12-03 19:58    [W:0.079 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site