On Fri, Jun 3, 2022 at 2:51 PM Nuno Sá <noname.nuno@xxxxxxxxx> wrote: > On Fri, 2022-06-03 at 13:52 +0200, Andy Shevchenko wrote: > > On Thu, Jun 2, 2022 at 4:04 PM Nuno Sá <nuno.sa@xxxxxxxxxx> wrote: ... > > I think you may split this in an easy way, i.e. convert core to > > fwnode, while providing inliners for of_node cases (like it's done in > > IRQ domain) and then remove them after conversion. > > I see, in our case that might be really simple as we only have one user > of devm_of_iio_channel_get_by_name() which is the only api directly > using OF. of_iio_channel_get_by_name() has no users and all the other > public APIs use 'struct device' so we can do the conversion > internally... Even better than I expected! ... > > That said, I think what you need is to split this series to three > > logical parts: > > 1) shuffle header inclusions around so, iio.h will use forward > > declaration (on driver basis); > > 2) convert inkern.c to fwnode while providing OF wrappers > > (to_of_node() helps); > > Just to be clear, we should still add an fwnode_xlate() callback? So we > have both temporarily and if some new driver needs this interface it > can already use it instead of of_xlate... No, I mean to leave a callback to be OF-specific and pass fwnode with to_of_node(). Then convert it separately either on per driver basis (if possible and makes sense) or altogether. > > 3) convert of_xlate (on driver basis it might be tricky, up to you). > > Yeah, I might see how easy it is to fully convert the drivers using > of_xlate. If easy enough, I'll probably do it... -- With Best Regards, Andy Shevchenko