diff options
author | Sean Anderson <sean.anderson@seco.com> | 2021-10-22 12:35:48 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-10-24 13:44:39 +0100 |
commit | 4d98bb0d7ec2d0b417df6207b0bafe1868bad9f8 (patch) | |
tree | 38a6a96364268657da365ed2e58a9949b04b7784 /drivers/net/ethernet/cadence | |
parent | 25790844006af9538e1a01554bc043b404fd8845 (diff) | |
download | lwn-4d98bb0d7ec2d0b417df6207b0bafe1868bad9f8.tar.gz lwn-4d98bb0d7ec2d0b417df6207b0bafe1868bad9f8.zip |
net: macb: Use mdio child node for MDIO bus if it exists
This allows explicitly specifying which children are present on the mdio
bus. Additionally, it allows for non-phy MDIO devices on the bus.
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cadence')
-rw-r--r-- | drivers/net/ethernet/cadence/macb_main.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index 029dea2873e3..30a65cac9e87 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -898,6 +898,17 @@ static int macb_mdiobus_register(struct macb *bp) { struct device_node *child, *np = bp->pdev->dev.of_node; + /* If we have a child named mdio, probe it instead of looking for PHYs + * directly under the MAC node + */ + child = of_get_child_by_name(np, "mdio"); + if (np) { + int ret = of_mdiobus_register(bp->mii_bus, child); + + of_node_put(child); + return ret; + } + if (of_phy_is_fixed_link(np)) return mdiobus_register(bp->mii_bus); |