Skip to content

Commit d509ac2

Browse files
ahalaneyNipaLocal
authored and
NipaLocal
committed
net: stmmac: Handle disabled MDIO busses from devicetree
Many hardware configurations have the MDIO bus disabled, and are instead using some other MDIO bus to talk to the MAC's phy. of_mdiobus_register() returns -ENODEV in this case. Let's handle it gracefully instead of failing to probe the MAC. Fixes: 47dd7a5 ("net: add support for STMicroelectronics Ethernet controllers.") Signed-off-by: Andrew Halaney <[email protected]> Reviewed-by: Serge Semin <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent 379eee2 commit d509ac2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,11 @@ int stmmac_mdio_register(struct net_device *ndev)
591591
new_bus->parent = priv->device;
592592

593593
err = of_mdiobus_register(new_bus, mdio_node);
594-
if (err != 0) {
594+
if (err == -ENODEV) {
595+
err = 0;
596+
dev_info(dev, "MDIO bus is disabled\n");
597+
goto bus_register_fail;
598+
} else if (err) {
595599
dev_err_probe(dev, err, "Cannot register the MDIO bus\n");
596600
goto bus_register_fail;
597601
}

0 commit comments

Comments
 (0)