Skip to content

Commit

Permalink
net: mdio: of_mdiobus_register(): fall back to mdiobus_register() for…
Browse files Browse the repository at this point in the history
… !CONFIG_OF

If CONFIG_OF is not set, make of_mdiobus_register() call
mdiobus_register() instead of returning -ENOSYS.

This way, we can just call of_mdiobus_register() from all DT-enabled
drivers to handle the compat cases.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Suggested-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Daniel Mack authored and David S. Miller committed May 7, 2014
1 parent aeefa1e commit 23a456f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion include/linux/of_mdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np);
#else /* CONFIG_OF */
static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
{
return -ENOSYS;
/*
* Fall back to the non-DT function to register a bus.
* This way, we don't have to keep compat bits around in drivers.
*/

return mdiobus_register(mdio);
}

static inline struct phy_device *of_phy_find_device(struct device_node *phy_np)
Expand Down

0 comments on commit 23a456f

Please sign in to comment.