eth_init() overwrites the error from eth_start_udev() with eth_errno, which may still be zero after a successful device probe. This can report success even when no Ethernet device could be started, causing DHCP to enter the BOOTP retry loop instead of failing immediately.
Preserve the return value from eth_start_udev() so that callers can detect the initialization failure. Signed-off-by: Terry Zhou (Synaptics) <[email protected]> --- Validated using downstream SDK U-Boot on Synaptics VS640 and SL2610 Without the fix, driver startup errors are followed by BOOTP retries. With the fix, DHCP fails without entering the BOOTP retry loop. DHCP succeeds with the cable connected. net/eth-uclass.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/net/eth-uclass.c b/net/eth-uclass.c index 07ec59b97f0..18efbfeda71 100644 --- a/net/eth-uclass.c +++ b/net/eth-uclass.c @@ -349,9 +349,7 @@ int eth_init(void) debug("Trying %s\n", current->name); ret = eth_start_udev(current); - if (ret < 0) - ret = eth_errno; - else + if (!ret) break; debug("FAIL\n"); base-commit: 8649a54d301a4d0ac526324c7a7ad2574939ff27 -- 2.34.1
