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

Signed-off-by: Jerome Forissier <[email protected]>
---
 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

Reply via email to