I have a board where these two lines are always printed during boot: imx-dwmac 30bf0000.ethernet: Cannot register the MDIO bus imx-dwmac 30bf0000.ethernet: stmmac_dvr_probe: MDIO bus (id: 1) registration failed It's perfectly fine, and the device is successfully (and silently, as far as the console goes) probed later. Use dev_err_probe() instead, which will demote these messages to debug level (thus removing the alarming messages from the console) when the error is -EPROBE_DEFER, and also has the advantage of including the error code if/when it happens to be something other than -EPROBE_DEFER. While here, add the missing \n to one of the format strings.
Unified · Split
| @@ -7129,9 +7129,9 @@ int stmmac_dvr_probe(struct device *device, · 7128 unmodified lines | ||
| 7129 | 7129 | /* MDIO bus Registration */ |
| 7130 | 7130 | ret = stmmac_mdio_register(ndev); |
| 7131 | 7131 | if (ret < 0) { |
| 7132 | − dev_err(priv->device, | |
| 7133 | − "%s: MDIO bus (id: %d) registration failed", | |
| 7134 | − __func__, priv->plat->bus_id); | |
| 7132 | + dev_err_probe(priv->device, ret, | |
| 7133 | + "%s: MDIO bus (id: %d) registration failed\n", | |
| 7134 | + __func__, priv->plat->bus_id); | |
| 7135 | 7135 | goto error_mdio_register; |
| 7136 | 7136 | } |
| 7137 | 7137 | } |
| @@ -482,7 +482,7 @@ int stmmac_mdio_register(struct net_device *ndev) · 481 unmodified lines | ||
| 482 | 482 | |
| 483 | 483 | err = of_mdiobus_register(new_bus, mdio_node); |
| 484 | 484 | if (err != 0) { |
| 485 | − dev_err(dev, "Cannot register the MDIO bus\n"); | |
| 485 | + dev_err_probe(dev, err, "Cannot register the MDIO bus\n"); | |
| 486 | 486 | goto bus_register_fail; |
| 487 | 487 | } |
| 488 | 488 | |