Skip to content

Commit 955acb6

Browse files
sean-anderson-secoclaudiubeznea
authored andcommitted
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>
1 parent e096438 commit 955acb6

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,17 @@ static int macb_mdiobus_register(struct macb *bp)
903903
{
904904
struct device_node *child, *np = bp->pdev->dev.of_node;
905905

906+
/* If we have a child named mdio, probe it instead of looking for PHYs
907+
* directly under the MAC node
908+
*/
909+
child = of_get_child_by_name(np, "mdio");
910+
if (np) {
911+
int ret = of_mdiobus_register(bp->mii_bus, child);
912+
913+
of_node_put(child);
914+
return ret;
915+
}
916+
906917
if (of_phy_is_fixed_link(np))
907918
return mdiobus_register(bp->mii_bus);
908919

0 commit comments

Comments
 (0)