[PATCH v4 0/2] device property: Add scoped fwnode child node iterators

Jean-François Lessard posted 2 patches 1 month ago
drivers/i2c/i2c-core-slave.c |  3 +--
include/linux/property.h     | 10 ++++++++++
2 files changed, 11 insertions(+), 2 deletions(-)
[PATCH v4 0/2] device property: Add scoped fwnode child node iterators
Posted by Jean-François Lessard 1 month ago
This series adds scoped versions of fwnode iterator macros and converts
existing manual implementation to use them.

The first patch adds the infrastructure macros following existing patterns
for scoped iterators in the kernel. The second patch demonstrates
fwnode_for_each_child_node_scoped() usage by converting existing manual
__free() usage in i2c-core-slave.c.

This series introduces infrastructure for the TM16XX driver series,
being the first user of fwnode_for_each_available_child_node_scoped().
See the related patch series:
  auxdisplay: Add TM16xx 7-segment LED matrix display controllers driver

Changes in v4:
- drop the fwnode_for_each_named_child_node_scoped() variant (no user)
- add Reviewed-by tag to commit message of patch 2/2

Changes in v3:
- Split into separate patches as requested
- Infrastructure addition in patch 1/2
- Usage example in patch 2/2

Changes in v2:
- replace manual __free(fwnode_handle) of i2c-core-slave.c with
  fwnode_for_each_child_node_scoped

Jean-François Lessard (2):
  device property: Add scoped fwnode child node iterators
  i2c: core: Use fwnode_for_each_child_node_scoped()

 drivers/i2c/i2c-core-slave.c |  3 +--
 include/linux/property.h     | 10 ++++++++++
 2 files changed, 11 insertions(+), 2 deletions(-)

-- 
2.43.0

Re: [PATCH v4 0/2] device property: Add scoped fwnode child node iterators
Posted by Andy Shevchenko 4 weeks, 1 day ago
On Tue, Sep 02, 2025 at 03:04:38PM -0400, Jean-François Lessard wrote:
> This series adds scoped versions of fwnode iterator macros and converts
> existing manual implementation to use them.
> 
> The first patch adds the infrastructure macros following existing patterns
> for scoped iterators in the kernel. The second patch demonstrates
> fwnode_for_each_child_node_scoped() usage by converting existing manual
> __free() usage in i2c-core-slave.c.
> 
> This series introduces infrastructure for the TM16XX driver series,
> being the first user of fwnode_for_each_available_child_node_scoped().
> See the related patch series:
>   auxdisplay: Add TM16xx 7-segment LED matrix display controllers driver

It might be good to have an immutable branch for me from i2c core.
Wolfram, can you provide a such if no objections?

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH v4 0/2] device property: Add scoped fwnode child node iterators
Posted by Wolfram Sang 4 weeks ago
> It might be good to have an immutable branch for me from i2c core.
> Wolfram, can you provide a such if no objections?

Sure thing, I can do that. But there is still discussion on patch 1, so
I will wait for an outcome there.

Re: [PATCH v4 0/2] device property: Add scoped fwnode child node iterators
Posted by Andy Shevchenko 4 weeks ago
On Thu, Sep 04, 2025 at 11:49:25AM +0200, Wolfram Sang wrote:
> 
> > It might be good to have an immutable branch for me from i2c core.
> > Wolfram, can you provide a such if no objections?
> 
> Sure thing, I can do that. But there is still discussion on patch 1, so
> I will wait for an outcome there.

But it seems that the discussion can be implemented in a followup?
I think we are not in hurry anyway, so let see if it settles down soon.

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH v4 0/2] device property: Add scoped fwnode child node iterators
Posted by Wolfram Sang 3 weeks, 1 day ago
On Thu, Sep 04, 2025 at 12:59:52PM +0300, Andy Shevchenko wrote:
> On Thu, Sep 04, 2025 at 11:49:25AM +0200, Wolfram Sang wrote:
> > 
> > > It might be good to have an immutable branch for me from i2c core.
> > > Wolfram, can you provide a such if no objections?
> > 
> > Sure thing, I can do that. But there is still discussion on patch 1, so
> > I will wait for an outcome there.
> 
> But it seems that the discussion can be implemented in a followup?
> I think we are not in hurry anyway, so let see if it settles down soon.

I pushed out an immutable branch now:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/immutable/scoped_fwnode_child

Please have a look if I got the tags correct. Once confirmed, I will
merge it into i2c/for-mergewindow and Andy can pull it as well.

Re: [PATCH v4 0/2] device property: Add scoped fwnode child node iterators
Posted by Wolfram Sang 2 weeks, 6 days ago
Andi,

> > > > It might be good to have an immutable branch for me from i2c core.
> > > > Wolfram, can you provide a such if no objections?
> > > 
> > > Sure thing, I can do that. But there is still discussion on patch 1, so
> > > I will wait for an outcome there.
> > 
> > But it seems that the discussion can be implemented in a followup?
> > I think we are not in hurry anyway, so let see if it settles down soon.
> 
> I pushed out an immutable branch now:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/immutable/scoped_fwnode_child
> 
> Please have a look if I got the tags correct. Once confirmed, I will
> merge it into i2c/for-mergewindow and Andy can pull it as well.

Andy, did you pull this immutable branch already?

Re: [PATCH v4 0/2] device property: Add scoped fwnode child node iterators
Posted by Andy Shevchenko 2 weeks, 4 days ago
On Sat, Sep 13, 2025 at 12:28:22AM +0200, Wolfram Sang wrote:

> > > > > It might be good to have an immutable branch for me from i2c core.
> > > > > Wolfram, can you provide a such if no objections?
> > > > 
> > > > Sure thing, I can do that. But there is still discussion on patch 1, so
> > > > I will wait for an outcome there.
> > > 
> > > But it seems that the discussion can be implemented in a followup?
> > > I think we are not in hurry anyway, so let see if it settles down soon.
> > 
> > I pushed out an immutable branch now:
> > 
> > git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/immutable/scoped_fwnode_child
> > 
> > Please have a look if I got the tags correct. Once confirmed, I will
> > merge it into i2c/for-mergewindow and Andy can pull it as well.
> 
> Andy, did you pull this immutable branch already?

Me? No, not yet.

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH v4 0/2] device property: Add scoped fwnode child node iterators
Posted by Danilo Krummrich 4 weeks ago
On Thu Sep 4, 2025 at 11:59 AM CEST, Andy Shevchenko wrote:
> On Thu, Sep 04, 2025 at 11:49:25AM +0200, Wolfram Sang wrote:
>> 
>> > It might be good to have an immutable branch for me from i2c core.
>> > Wolfram, can you provide a such if no objections?
>> 
>> Sure thing, I can do that. But there is still discussion on patch 1, so
>> I will wait for an outcome there.
>
> But it seems that the discussion can be implemented in a followup?

If Sakari attempts the rework, and we can prove this doesn't regress existing
users, removing fwnode_for_each_available_child_node_scoped() in the context
of the rework again should be trivial.

Given that, I don't see a reason to stall people working with the existing
semantics of the API in the meantime.

So, AFAIC, my ACK is still valid.
Re: [PATCH v4 0/2] device property: Add scoped fwnode child node iterators
Posted by Sakari Ailus 4 weeks ago
Hi Danilo, others,

On Thu, Sep 04, 2025 at 12:13:53PM +0200, Danilo Krummrich wrote:
> On Thu Sep 4, 2025 at 11:59 AM CEST, Andy Shevchenko wrote:
> > On Thu, Sep 04, 2025 at 11:49:25AM +0200, Wolfram Sang wrote:
> >> 
> >> > It might be good to have an immutable branch for me from i2c core.
> >> > Wolfram, can you provide a such if no objections?
> >> 
> >> Sure thing, I can do that. But there is still discussion on patch 1, so
> >> I will wait for an outcome there.
> >
> > But it seems that the discussion can be implemented in a followup?
> 
> If Sakari attempts the rework, and we can prove this doesn't regress existing
> users, removing fwnode_for_each_available_child_node_scoped() in the context
> of the rework again should be trivial.

It would perhaps be trivial but in this case I really wouldn't add it in
the first place: it's unused. Either way, feel free to add:

Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>

> 
> Given that, I don't see a reason to stall people working with the existing
> semantics of the API in the meantime.

-- 
Regards,

Sakari Ailus