Messages in this thread |  | | Date | Mon, 4 May 2026 17:16:57 +0200 | | From | Andrew Lunn <> | | Subject | Re: [PATCH net-next v1 0/5] net: mdiobus: HIde ACPI implementation |
| |
On Mon, May 04, 2026 at 04:49:35PM +0300, Andy Shevchenko wrote: > On Mon, May 04, 2026 at 03:02:54PM +0200, Andrew Lunn wrote: > > On Mon, May 04, 2026 at 09:29:51AM +0200, Andy Shevchenko wrote: > > > This mini-series is dedicated to hiding ACPI implementation details > > > from the wider users as they (as of today) do not need to know that. > > > > Please could you expand on that. ACPI != OF. They have different > > bindings, so you need different implementations. > > As of today the users that want ACPI also have the OF support. Even without > that if the device is pure ACPI supported one (and somehow never going to DT) > the proposed API (see the first patch) will be no-op in case when CONFIG_ACPI=n > or when it's a non-ACPI platform with no support of the device. Hence, the > pure ACPI (and actually OF as well) do not need to be exposed. The decision is > made based on the type of firmware node.
I see two different things here:
You are refactoring code into a helper, so reducing the amount of duplicated code. That in itself is good.
However, we have the problem in general that developers think that OF and ACPI do the same thing. And that is not true. OF MDIO busses have support for a GPIO used as a reset. In retrospect, that was a bad idea. The documented ACPI binding does not have this, and if anybody was to suggest adding it, i want to NACK it.
Having OF code and ACPI code to instantiate the MDIO bus makes it clearer they are different things. fwnode gives the impression they are the same, which is not true. Hence i don't like fwnode at this level.
Where fwnode makes sense is deeper down in the implementation of the bindings, for properties which are the same in both bindings. Then you can use fwnode_ for the shared properties, of_ for the OF only properties, and acpi_ for the ACPI only properties.
So although i like the reduction in duplicated code, i think overall it makes the code worse because developers are more likely to wrongly understand it.
Andrew
|  |