On Mon, 12 Feb 2024 14:03:29 +0200 Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote: > On Sun, Feb 11, 2024 at 05:42:28PM +0000, Jonathan Cameron wrote: > > From: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx> > > > > Since RFC: > > - Provide a for_each_available_child_of_node_scoped() variant and > > use that whenever we aren't specifically trying to include disabled > > nodes. > > - Fix the for_each_child_of_node_scoped() to not use a mix of > > _available_ and other calls. > > - Include a few more examples. The last one is there to show that > > not all uses of the __free(device_node) call are due to the loops. > > I'm a bit skeptical about need of this work. What I would prefer to see > is getting rid of OF-centric drivers in IIO. With that, we would need > only fwnode part to be properly implemented. > To be honest main reason for doing of first was that they have unit tests :) The IIO drivers were more of a proving ground than cases I really cared out cleaning up. However I'm always of the view that better to make some improvement now than wait for a perfect improvement later. However one or two are not going to be converted to fwnode handling any time soon because they make use of phandle based referencing for driver specific hook ups that isn't going to get generic handling any time soon. I'll probably focus on getting the fwnode version of this moving forwards first though and 'maybe' convert a few of the easier ones of these over to that framework to reduce how many users of this we end up with in IIO. Jonathan