Re: [RFC PATCH 0/2] Add software node support to regulator framework

From: Andy Shevchenko
Date: Tue Jul 13 2021 - 11:56:40 EST


On Tue, Jul 13, 2021 at 6:25 PM Mark Brown <broonie@xxxxxxxxxx> wrote:
> On Tue, Jul 13, 2021 at 12:32:26AM +0100, Daniel Scally wrote:

> > I do think it can simplify driver code too; a lot of them aren't written
> > to parse platform data to get the init data, as they're just relying on
> > reading it from devicetree so in the event that we get more cases like
> > this, we need to modify those drivers to look for platform data too. On
> > the other hand, even the drivers that don't directly call
> > of_get_regulator_init_data() still do that lookup during the
> > regulator_of_get_init_data() call in regulator_register(), so the ones
> > that do parse platform data for init_data structs will check DT as part
> > of regulator_register() anyway. Imitating that seems simpler to me.
>
> The driver code is trivial boilerplate, assuming someone doesn't go and
> implement a helper to register stuff separately like I suggested. The
> proposed swnode stuff would involve duplicating the DT parsing code.
> This seems like a whole lot of effort for something that provides a
> worse result than either of the existing things.

I'm not sure I follow. Where did you see the duplication when I saw
the other way around?
Converting code from OF to fwnode APIs in most cases is smooth and
doesn't add any overhead to the codebase,

--
With Best Regards,
Andy Shevchenko