On Tue, Jun 15, 2021 at 6:14 PM Marcin Wojtas [off-list ref] wrote:
Hi,
niedz., 13 cze 2021 o 21:20 Andrew Lunn [off-list ref] napisał(a):
quoted
quoted
- ret = of_mdiobus_register(bus, pdev->dev.of_node);
+ if (pdev->dev.of_node)
+ ret = of_mdiobus_register(bus, pdev->dev.of_node);
+ else if (is_acpi_node(pdev->dev.fwnode))
+ ret = acpi_mdiobus_register(bus, pdev->dev.fwnode);
+ else
+ ret = -EINVAL;
This seems like something which could be put into fwnode_mdio.c.
Agree - I'll create a simple fwnode_mdiobus_register() helper there.
Please, also convert the users that we will not have again some
open-coded examples here and there
https://lore.kernel.org/netdev/162344280835.13501.16334655818490594799.git-patchwork-notify@kernel.org/T/#mff706861dea5d3be037d1546fa9c362b27d5839b (local)
(Btw, note the is_of_node() usage there, so should
fwnode_mdiobus_register() have)
--
With Best Regards,
Andy Shevchenko