Re: [net-next: PATCH 1/3] net: mvmdio: add ACPI support

From: Andy Shevchenko
Date: Tue Jun 15 2021 - 15:53:39 EST


On Tue, Jun 15, 2021 at 6:14 PM Marcin Wojtas <mw@xxxxxxxxxxxx> wrote:
> Hi,
> niedz., 13 cze 2021 o 21:20 Andrew Lunn <andrew@xxxxxxx> napisał(a):
> >
> > > - 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@xxxxxxxxxx/T/#mff706861dea5d3be037d1546fa9c362b27d5839b

(Btw, note the is_of_node() usage there, so should
fwnode_mdiobus_register() have)

--
With Best Regards,
Andy Shevchenko