Commit 5939b6db authored by Wei Fang's avatar Wei Fang Committed by Paolo Abeni
Browse files

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: 50bfd9c0 ("net: enetc: set external PHY address in IERB for i.MX94 ENETC")
Signed-off-by: default avatarWei Fang <wei.fang@nxp.com>
Reviewed-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20251222022628.4016403-1-wei.fang@nxp.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 99537d5c
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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");