* [PATCH] net: stmmac: Don't log error message in case of -EPROBE_DEFER.
@ 2020-11-04 14:15 Markus Bauer
2020-11-04 14:27 ` Robin Murphy
0 siblings, 1 reply; 2+ messages in thread
From: Markus Bauer @ 2020-11-04 14:15 UTC (permalink / raw)
Cc: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu,
David S . Miller, Maxime Coquelin, netdev, linux-stm32,
linux-arm-kernel, linux-kernel, Markus Bauer
Remove error messages that might confuse users when error is just -517 / -EPROBE_DEFER.
[...]
imx-dwmac 30bf0000.ethernet: Cannot register the MDIO bus
imx-dwmac 30bf0000.ethernet: stmmac_dvr_probe: MDIO bus (id: 0) registration failed
[...]
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 ++++---
drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 6 ++++--
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 33272a12989a..7d1cdd576b91 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -4857,9 +4857,10 @@ int stmmac_dvr_probe(struct device *device,
/* MDIO bus Registration */
ret = stmmac_mdio_register(ndev);
if (ret < 0) {
- dev_err(priv->device,
- "%s: MDIO bus (id: %d) registration failed",
- __func__, priv->plat->bus_id);
+ if (ret != -EPROBE_DEFER)
+ dev_err(priv->device,
+ "%s: MDIO bus (id: %d) registration failed, err=%d",
+ __func__, priv->plat->bus_id, ret);
goto error_mdio_register;
}
}
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
index 226e5a4bf21c..8e202f63da31 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
@@ -401,8 +401,10 @@ int stmmac_mdio_register(struct net_device *ndev)
new_bus->parent = priv->device;
err = of_mdiobus_register(new_bus, mdio_node);
- if (err != 0) {
- dev_err(dev, "Cannot register the MDIO bus\n");
+ if (err) {
+ if (err != -EPROBE_DEFER)
+ dev_err(dev,
+ "Cannot register the MDIO bus, err=%d\n", err);
goto bus_register_fail;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: stmmac: Don't log error message in case of -EPROBE_DEFER.
2020-11-04 14:15 [PATCH] net: stmmac: Don't log error message in case of -EPROBE_DEFER Markus Bauer
@ 2020-11-04 14:27 ` Robin Murphy
0 siblings, 0 replies; 2+ messages in thread
From: Robin Murphy @ 2020-11-04 14:27 UTC (permalink / raw)
To: Markus Bauer
Cc: Alexandre Torgue, netdev, linux-kernel, linux-stm32, Jose Abreu,
Maxime Coquelin, Giuseppe Cavallaro, David S . Miller,
linux-arm-kernel
On 2020-11-04 14:15, Markus Bauer wrote:
> Remove error messages that might confuse users when error is just -517 / -EPROBE_DEFER.
>
> [...]
> imx-dwmac 30bf0000.ethernet: Cannot register the MDIO bus
> imx-dwmac 30bf0000.ethernet: stmmac_dvr_probe: MDIO bus (id: 0) registration failed
> [...]
FYI we have dev_err_probe() for this now.
Robin.
> ---
> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 ++++---
> drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 6 ++++--
> 2 files changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 33272a12989a..7d1cdd576b91 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -4857,9 +4857,10 @@ int stmmac_dvr_probe(struct device *device,
> /* MDIO bus Registration */
> ret = stmmac_mdio_register(ndev);
> if (ret < 0) {
> - dev_err(priv->device,
> - "%s: MDIO bus (id: %d) registration failed",
> - __func__, priv->plat->bus_id);
> + if (ret != -EPROBE_DEFER)
> + dev_err(priv->device,
> + "%s: MDIO bus (id: %d) registration failed, err=%d",
> + __func__, priv->plat->bus_id, ret);
> goto error_mdio_register;
> }
> }
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
> index 226e5a4bf21c..8e202f63da31 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
> @@ -401,8 +401,10 @@ int stmmac_mdio_register(struct net_device *ndev)
> new_bus->parent = priv->device;
>
> err = of_mdiobus_register(new_bus, mdio_node);
> - if (err != 0) {
> - dev_err(dev, "Cannot register the MDIO bus\n");
> + if (err) {
> + if (err != -EPROBE_DEFER)
> + dev_err(dev,
> + "Cannot register the MDIO bus, err=%d\n", err);
> goto bus_register_fail;
> }
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-04 14:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-04 14:15 [PATCH] net: stmmac: Don't log error message in case of -EPROBE_DEFER Markus Bauer
2020-11-04 14:27 ` Robin Murphy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).