Skip to content

Commit b2d7094

Browse files
ofirshedkalowsk
authored andcommitted
drivers: ethernet: nxp_enet: Fix PHY configure for fixed-link config
Update the driver to handle -ENOSYS from phy_configure_link(), which is now returned when the cfg_link callback is missing (e.g., in fixed-link PHYs). Signed-off-by: Ofir Shemesh <ofirshemesh777@gmail.com>
1 parent 0ec49fa commit b2d7094

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/ethernet/eth_nxp_enet.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -474,17 +474,18 @@ static int nxp_enet_phy_configure(const struct device *phy, uint8_t phy_mode)
474474
/* Configure the PHY */
475475
ret = phy_configure_link(phy, speeds, 0);
476476

477-
if (ret == -ENOTSUP) {
477+
if (ret == -ENOTSUP || ret == -ENOSYS) {
478478
phy_get_link_state(phy, &state);
479479

480480
if (state.is_up) {
481-
LOG_WRN("phy_configure_link returned -ENOTSUP, but link is up. "
481+
LOG_WRN("phy_configure_link returned %d, but link is up. "
482482
"Speed: %s, %s-duplex",
483+
ret,
483484
PHY_LINK_IS_SPEED_1000M(state.speed) ? "1 Gbits" :
484485
PHY_LINK_IS_SPEED_100M(state.speed) ? "100 Mbits" : "10 Mbits",
485486
PHY_LINK_IS_FULL_DUPLEX(state.speed) ? "full" : "half");
486487
} else {
487-
LOG_ERR("phy_configure_link returned -ENOTSUP and link is down.");
488+
LOG_ERR("phy_configure_link returned %d and link is down.", ret);
488489
return -ENETDOWN;
489490
}
490491
} else if (ret) {

0 commit comments

Comments
 (0)