lkml.org 
[lkml]   [2022]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 6/9] i2c: fwnode: add fwnode_find_i2c_adapter_by_node()
Le Fri, 25 Mar 2022 16:35:52 +0200,
Andy Shevchenko <andriy.shevchenko@linux.intel.com> a écrit :

> On Fri, Mar 25, 2022 at 12:31:45PM +0100, Clément Léger wrote:
> > Add fwnode_find_i2c_adapter_by_node() which allows to retrieve a i2c
> > adapter using a fwnode. Since dev_fwnode() uses the fwnode provided by
> > the of_node member of the device, this will also work for devices were
> > the of_node has been set and not the fwnode field.
> > For acpi nodes, the check for parent node is skipped since
> > i2c_acpi_find_adapter_by_handle() does not check it and we don't want
> > to change this behavior.
>
> ...
>
> > +#include <linux/device.h>
> > +#include <linux/i2c.h>
>
> Missed headers so far:
> acpi.h

Indeed, will check that.

>
> ...
>
> > +static int fwnode_dev_or_parent_node_match(struct device *dev, const void *data)
> > +{
> > + if (device_match_fwnode(dev, data))
> > + return 1;
> > +
> > + /*
> > + * For ACPI device node, the behavior is to not match the parent (see
> > + * did not checked the )
> > + */
>
> Would it be harmful to drop this check?

Can't tell, I would not want to introduce some behavior wrt to parent
node for ACPI since it was not done this way. Might works in 99% of the
case though.

If ok with that, I can drop it.


--
Clément Léger,
Embedded Linux and Kernel engineer at Bootlin
https://bootlin.com

\
 
 \ /
  Last update: 2022-03-25 16:20    [W:0.075 / U:1.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site