[net-next PATCH v3 11/15] net: mdiobus: Introduce fwnode_mdiobus_register()

Andy Shevchenko andy.shevchenko at gmail.com
Tue Jan 12 10:52:03 EST 2021


On Tue, Jan 12, 2021 at 3:42 PM Calvin Johnson
<calvin.johnson at oss.nxp.com> wrote:
>
> Introduce fwnode_mdiobus_register() to register PHYs on the  mdiobus.
> If the fwnode is DT node, then call of_mdiobus_register().
> If it is an ACPI node, then call acpi_mdiobus_register().

...

> +/**
> + * fwnode_mdiobus_register - Register mii_bus and create PHYs from fwnode
> + * @mdio: pointer to mii_bus structure
> + * @fwnode: pointer to fwnode of MDIO bus.
> + *
> + * This function returns of_mdiobus_register() for DT and
> + * acpi_mdiobus_register() for ACPI.
> + */
> +int fwnode_mdiobus_register(struct mii_bus *mdio, struct fwnode_handle *fwnode)
> +{
> +       if (is_of_node(fwnode))
> +               return of_mdiobus_register(mdio, to_of_node(fwnode));
> +       else if (is_acpi_node(fwnode))

Redundant 'else'

> +               return acpi_mdiobus_register(mdio, fwnode);
> +
> +       return -EINVAL;
> +}

-- 
With Best Regards,
Andy Shevchenko



More information about the linux-arm-kernel mailing list