devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Clément Léger" <clement.leger@bootlin.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Daniel Scally <djrscally@gmail.com>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Wolfram Sang <wsa@kernel.org>, Peter Rosin <peda@axentia.se>,
	Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	Len Brown <lenb@kernel.org>, Hans de Goede <hdegoede@redhat.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Allan Nielsen <allan.nielsen@microchip.com>,
	linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org,
	linux-i2c@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v3 6/9] i2c: fwnode: add fwnode_find_i2c_adapter_by_node()
Date: Fri, 25 Mar 2022 16:09:27 +0100	[thread overview]
Message-ID: <20220325160927.30e5aef8@fixe.home> (raw)
In-Reply-To: <Yj3TSBEY/P7d8XJj@smile.fi.intel.com>

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

  reply	other threads:[~2022-03-25 15:13 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25 11:31 [PATCH v3 0/9] introduce fwnode in the I2C subsystem Clément Léger
2022-03-25 11:31 ` [PATCH v3 1/9] of: add of_property_read_string_array_index() Clément Léger
2022-03-29 23:32   ` Rob Herring
2022-03-25 11:31 ` [PATCH v3 2/9] of: unittests: add tests for of_property_read_string_array_index() Clément Léger
2022-03-29 23:32   ` Rob Herring
2022-03-25 11:31 ` [PATCH v3 3/9] device property: add index argument to property_read_string_array() callback Clément Léger
2022-03-25 14:30   ` Andy Shevchenko
2022-03-28 14:28     ` Clément Léger
2022-04-05 13:22       ` Rafael J. Wysocki
2022-04-05 13:27         ` Clément Léger
2022-03-25 11:31 ` [PATCH v3 4/9] device property: add fwnode_property_read_string_index() Clément Léger
2022-03-25 14:33   ` Andy Shevchenko
2022-03-25 15:10     ` Clément Léger
2022-03-25 11:31 ` [PATCH v3 5/9] device property: add tests for fwnode_property_read_string_index() Clément Léger
2022-03-25 11:31 ` [PATCH v3 6/9] i2c: fwnode: add fwnode_find_i2c_adapter_by_node() Clément Léger
2022-03-25 14:35   ` Andy Shevchenko
2022-03-25 15:09     ` Clément Léger [this message]
2022-03-25 15:56       ` Andy Shevchenko
2022-03-25 16:04         ` Clément Léger
2022-03-25 16:29           ` Andy Shevchenko
2022-03-25 11:31 ` [PATCH v3 7/9] i2c: of: use fwnode_get_i2c_adapter_by_node() Clément Léger
2022-03-25 11:31 ` [PATCH v3 8/9] i2c: mux: pinctrl: remove CONFIG_OF dependency and use fwnode API Clément Léger
2022-03-25 14:38   ` Andy Shevchenko
2022-03-25 16:48   ` Peter Rosin
2022-03-31  9:40     ` Clément Léger
2022-03-25 11:31 ` [PATCH v3 9/9] i2c: mux: add support for fwnode Clément Léger
2022-05-14 14:47 ` [PATCH v3 0/9] introduce fwnode in the I2C subsystem Wolfram Sang
2022-05-15 21:34   ` Peter Rosin
2022-05-16  7:34     ` Clément Léger
2022-05-16  8:36       ` Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220325160927.30e5aef8@fixe.home \
    --to=clement.leger@bootlin.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=allan.nielsen@microchip.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=djrscally@gmail.com \
    --cc=frowand.list@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peda@axentia.se \
    --cc=rafael@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=wsa@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).