Skip to contentSkip to conversation

net: enetc: do not print error log if addr is 0

PATCH Applied Wei Fang 3 participants 3 messages Dec 22, 2025 – Dec 30, 2025

Subsystems (4)
lore
Share & tools
lore

Wei Fang

author maintainer
#0 lore raw

PATCH v2 1/1 net: enetc: do not print error log if addr is 0

A value of 0 for addr indicates that the IEB_LBCR register does not need to be configured, as its default value is 0. However, the driver will print an error log if addr is 0, so this issue needs to be fixed.

Fixes 50bfd9c06f0f ("net: enetc: set external PHY address in IERB for i.MX94 ENETC")

---
v2 changes:
Separate tests for "if (addr < 0)" and a later "if (!addr)".
v1: https://lore.kernel.org/imx/[email protected]/

---
 drivers/net/ethernet/freescale/enetc/netc_blk_ctrl.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/ethernet/freescale/enetc/netc_blk_ctrl.c +7 -1
index 443983fdecd9..7fd39f895290 100644
@@ -577,11 +577,17 @@ static int imx94_enetc_mdio_phyaddr_config(struct netc_blk_ctrl *priv,
 	}
 
 	addr = netc_get_phy_addr(np);
-	if (addr <= 0) {
+	if (addr < 0) {
 		dev_err(dev, "Failed to get PHY address\n");
 		return addr;
 	}
 
+	/* The default value of LaBCR[MDIO_PHYAD_PRTAD] is 0,
+	 * so no need to set the register.
+	 */
+	if (!addr)
+		return 0;
+
 	if (phy_mask & BIT(addr)) {
 		dev_err(dev,
 			"Find same PHY address in EMDIO and ENETC node\n");
Signature · 1 line
2.34.1
maintainer Reviewed-by on v2 1/1
#1 lore raw
Quoted 11 lines · Wei Fang

A value of 0 for addr indicates that the IEB_LBCR register does not need to be configured, as its default value is 0. However, the driver will print an error log if addr is 0, so this issue needs to be fixed.

Fixes 50bfd9c06f0f ("net: enetc: set external PHY address in IERB for i.MX94 ENETC")

---
v2 changes:
Separate tests for "if (addr < 0)" and a later "if (!addr)".
v1: https://lore.kernel.org/imx/[email protected]/
---

#2 lore raw
In reply to Wei Fang
This patch was applied to netdev/net.git (main) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <[email protected]>:

Quoted 8 lines · On Mon, 22 Dec 2025 10:26:28 +0800 you wrote:

A value of 0 for addr indicates that the IEB_LBCR register does not need to be configured, as its default value is 0. However, the driver will print an error log if addr is 0, so this issue needs to be fixed.

Fixes 50bfd9c06f0f ("net: enetc: set external PHY address in IERB for i.MX94 ENETC")

[...]

Here is the summary with links:
- [v2,net] net: enetc: do not print error log if addr is 0

    https://git.kernel.org/netdev/net/c/5939b6dbcda8

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html