[PATCH] net: guard call to tftp_start() with #if defined(CONFIG_CMD_TFTPBOOT)

Jerome Forissier jerome.forissier at linaro.org
Mon Sep 2 14:59:16 CEST 2024


net_auto_load() cannot call tftp_start() if CONFIG_CMD_TFTPBOOT is
disabled.

Signed-off-by: Jerome Forissier <jerome.forissier at linaro.org>
---
 net/net.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/net.c b/net/net.c
index d9bc9df643f..35961ba1c7d 100644
--- a/net/net.c
+++ b/net/net.c
@@ -334,6 +334,7 @@ void net_auto_load(void)
 		net_set_state(NETLOOP_SUCCESS);
 		return;
 	}
+#if defined(CONFIG_CMD_TFTPBOOT)
 	if (net_check_prereq(TFTPGET)) {
 /* We aren't expecting to get a serverip, so just accept the assigned IP */
 		if (IS_ENABLED(CONFIG_BOOTP_SERVERIP)) {
@@ -345,6 +346,7 @@ void net_auto_load(void)
 		return;
 	}
 	tftp_start(TFTPGET);
+#endif
 }
 
 static int net_init_loop(void)
-- 
2.40.1



More information about the U-Boot mailing list