History

net: stmmac: use dev_err_probe() for reporting mdio bus registration failure

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.

Rasmus Villemoes committed 4 years ago

Commit 839612d1 parent 7f36f792 files · +4 −4Browse files

Unified · Split

2 files
  1. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +3 −3
  2. drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +1 −1
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+3−3
@@ -7129,9 +7129,9 @@ int stmmac_dvr_probe(struct device *device, · 7128 unmodified lines
7129 /* MDIO bus Registration */7129 /* MDIO bus Registration */
7130 ret = stmmac_mdio_register(ndev);7130 ret = stmmac_mdio_register(ndev);
7131 if (ret < 0) {7131 if (ret < 0) {
7132 dev_err(priv->device,7132 dev_err_probe(priv->device, ret,
7133 "%s: MDIO bus (id: %d) registration failed",7133 "%s: MDIO bus (id: %d) registration failed\n",
7134 __func__, priv->plat->bus_id);7134 __func__, priv->plat->bus_id);
7135 goto error_mdio_register;7135 goto error_mdio_register;
7136 }7136 }
7137 }7137 }
drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c+1−1
@@ -482,7 +482,7 @@ int stmmac_mdio_register(struct net_device *ndev) · 481 unmodified lines
482 482
483 err = of_mdiobus_register(new_bus, mdio_node);483 err = of_mdiobus_register(new_bus, mdio_node);
484 if (err != 0) {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 goto bus_register_fail;486 goto bus_register_fail;
487 }487 }
488 488

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t