Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 11A98C83F1B for ; Thu, 10 Jul 2025 15:16:05 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 960B48362C; Thu, 10 Jul 2025 17:16:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gateworks.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 8F3DC83653; Thu, 10 Jul 2025 17:16:02 +0200 (CEST) Received: from finn.localdomain (finn.gateworks.com [108.161.129.64]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C438583285 for ; Thu, 10 Jul 2025 17:15:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gateworks.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tharvey@gateworks.com Received: from syn-068-189-091-139.biz.spectrum.com ([68.189.91.139] helo=tharvey.pdc.gateworks.com) by finn.localdomain with esmtp (Exim 4.95) (envelope-from ) id 1uZt09-008eQn-UH; Thu, 10 Jul 2025 15:15:58 +0000 From: Tim Harvey To: u-boot@lists.denx.de Cc: Jerome Forissier , Joe Hershberger , Ramon Fried , Tom Rini , Tim Harvey Subject: [PATCH] net: lwip: simplify net_lwip_eth_start Date: Thu, 10 Jul 2025 08:15:56 -0700 Message-Id: <20250710151556.3834583-1-tharvey@gateworks.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean For NET_LWIP eth_is_on_demand_init() is always 1 so remove the check and simplify the code. Suggested-by: Jerome Forissier Signed-off-by: Tim Harvey --- 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; -- 2.25.1