lkml.org 
[lkml]   [2021]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [net-next PATCH v3 11/15] net: mdiobus: Introduce fwnode_mdiobus_register()
On Tue, Jan 12, 2021 at 3:42 PM Calvin Johnson
<calvin.johnson@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

\
 
 \ /
  Last update: 2021-01-12 16:53    [W:0.274 / U:0.732 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site