Skip to content

Commit 5939b6d

Browse files
WeiFang-NXPPaolo Abeni
authored andcommitted
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: 50bfd9c ("net: enetc: set external PHY address in IERB for i.MX94 ENETC") Signed-off-by: Wei Fang <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 99537d5 commit 5939b6d

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

drivers/net/ethernet/freescale/enetc/netc_blk_ctrl.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,11 +577,17 @@ static int imx94_enetc_mdio_phyaddr_config(struct netc_blk_ctrl *priv,
577577
}
578578

579579
addr = netc_get_phy_addr(np);
580-
if (addr <= 0) {
580+
if (addr < 0) {
581581
dev_err(dev, "Failed to get PHY address\n");
582582
return addr;
583583
}
584584

585+
/* The default value of LaBCR[MDIO_PHYAD_PRTAD] is 0,
586+
* so no need to set the register.
587+
*/
588+
if (!addr)
589+
return 0;
590+
585591
if (phy_mask & BIT(addr)) {
586592
dev_err(dev,
587593
"Find same PHY address in EMDIO and ENETC node\n");

0 commit comments

Comments
 (0)