[PATCH] net: lwip: simplify net_lwip_eth_start

Jerome Forissier jerome.forissier at linaro.org
Thu Jul 10 17:31:46 CEST 2025



On 7/10/25 17:15, Tim Harvey wrote:
> For NET_LWIP eth_is_on_demand_init() is always 1 so remove the check and
> simplify the code.
> 
> Suggested-by: Jerome Forissier <jerome.forissier at linaro.org>
> Signed-off-by: Tim Harvey <tharvey at gateworks.com>
> ---
>  net/lwip/net-lwip.c | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/net/lwip/net-lwip.c b/net/lwip/net-lwip.c
> index d53faa39ba11..660ceb10cbe2 100644
> --- a/net/lwip/net-lwip.c
> +++ b/net/lwip/net-lwip.c
> @@ -184,16 +184,12 @@ int net_lwip_eth_start(void)
>  	int ret;
>  
>  	net_init();
> -	if (eth_is_on_demand_init()) {
> +	eth_halt();
> +	eth_set_current();
> +	ret = eth_init();
> +	if (ret < 0) {
>  		eth_halt();
> -		eth_set_current();
> -		ret = eth_init();
> -		if (ret < 0) {
> -			eth_halt();
> -			return ret;
> -		}
> -	} else {
> -		eth_init_state_only();
> +		return ret;
>  	}
>  
>  	return 0;

Reviewed-by: Jerome Forissier <jerome.forissier at linaro.org>

Thanks,
-- 
Jerome


More information about the U-Boot mailing list