global: Avoid indirect inclusion of <env.h> from <net.h>
Now that env_get_ip() has been removed, the include file <net.h> does
not need anything from <env.h>. Furthermore, include/env.h itself
includes other headers which can lead to longer indirect inclusion
paths. To prepare to remove <env.h> from <net.h> fix all of the
remaining places which had relied on this indirect inclusion to instead
include <env.h> directly.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> # net/lwip
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
Reviewed-by: Martyn Welch <martyn.welch@collabora.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
diff --git a/board/BuR/brppt2/board.c b/board/BuR/brppt2/board.c
index c0a1632..de206bd 100644
--- a/board/BuR/brppt2/board.c
+++ b/board/BuR/brppt2/board.c
@@ -7,6 +7,7 @@
*
*/
#include <cpu_func.h>
+#include <env.h>
#include <hang.h>
#include <init.h>
#include <spl.h>
diff --git a/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c b/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c
index b9f4700..8c9e983 100644
--- a/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c
+++ b/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c
@@ -7,6 +7,7 @@
#include <dwc3-uboot.h>
#include <efi.h>
#include <efi_loader.h>
+#include <env.h>
#include <errno.h>
#include <miiphy.h>
#include <netdev.h>
diff --git a/board/andestech/ae350/ae350.c b/board/andestech/ae350/ae350.c
index 1d9d4a9..9bdd2ab 100644
--- a/board/andestech/ae350/ae350.c
+++ b/board/andestech/ae350/ae350.c
@@ -6,6 +6,7 @@
#include <config.h>
#include <cpu_func.h>
+#include <env.h>
#include <flash.h>
#include <image.h>
#include <init.h>
diff --git a/board/data_modul/common/common.c b/board/data_modul/common/common.c
index 9e35dc5..7d34479 100644
--- a/board/data_modul/common/common.c
+++ b/board/data_modul/common/common.c
@@ -12,6 +12,7 @@
#include <asm/mach-imx/boot_mode.h>
#include <asm/mach-imx/iomux-v3.h>
#include <dm/uclass.h>
+#include <env.h>
#include <hang.h>
#include <i2c_eeprom.h>
#include <image.h>
diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c
index 21a908c..457d828 100644
--- a/board/gateworks/gw_ventana/gw_ventana.c
+++ b/board/gateworks/gw_ventana/gw_ventana.c
@@ -6,6 +6,7 @@
*/
#include <command.h>
+#include <env.h>
#include <fdt_support.h>
#include <gsc.h>
#include <hwconfig.h>
diff --git a/board/ge/b1x5v2/b1x5v2.c b/board/ge/b1x5v2/b1x5v2.c
index c1aacd1..ddb7304 100644
--- a/board/ge/b1x5v2/b1x5v2.c
+++ b/board/ge/b1x5v2/b1x5v2.c
@@ -17,6 +17,7 @@
#include <asm/io.h>
#include <asm/mach-imx/video.h>
#include <command.h>
+#include <env.h>
#include <i2c.h>
#include <input.h>
#include <ipu_pixfmt.h>
diff --git a/board/keymile/kmcent2/kmcent2.c b/board/keymile/kmcent2/kmcent2.c
index 783853d..0f43ebf 100644
--- a/board/keymile/kmcent2/kmcent2.c
+++ b/board/keymile/kmcent2/kmcent2.c
@@ -6,6 +6,7 @@
* Copyright 2013 Freescale Semiconductor, Inc.
*/
+#include <env.h>
#include <event.h>
#include <asm/cache.h>
#include <asm/fsl_fdt.h>
diff --git a/board/purism/librem5/librem5.c b/board/purism/librem5/librem5.c
index 8ca8792..5178ee6 100644
--- a/board/purism/librem5/librem5.c
+++ b/board/purism/librem5/librem5.c
@@ -6,6 +6,7 @@
#include <malloc.h>
#include <errno.h>
+#include <env.h>
#include <asm/io.h>
#include <miiphy.h>
#include <asm/mach-imx/iomux-v3.h>
diff --git a/board/siemens/iot2050/board.c b/board/siemens/iot2050/board.c
index d827f72..161210c 100644
--- a/board/siemens/iot2050/board.c
+++ b/board/siemens/iot2050/board.c
@@ -11,6 +11,7 @@
#include <config.h>
#include <bootstage.h>
#include <dm.h>
+#include <env.h>
#include <fdt_support.h>
#include <i2c.h>
#include <led.h>
diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c
index 0525f6e..b1ed29a 100644
--- a/board/ti/j721e/evm.c
+++ b/board/ti/j721e/evm.c
@@ -8,6 +8,7 @@
*/
#include <efi_loader.h>
+#include <env.h>
#include <generic-phy.h>
#include <image.h>
#include <net.h>
diff --git a/boot/bootmeth_efi.c b/boot/bootmeth_efi.c
index 0c9b4c3..0af23df 100644
--- a/boot/bootmeth_efi.c
+++ b/boot/bootmeth_efi.c
@@ -15,6 +15,7 @@
#include <dm.h>
#include <efi.h>
#include <efi_loader.h>
+#include <env.h>
#include <fs.h>
#include <malloc.h>
#include <mapmem.h>
diff --git a/boot/bootmeth_pxe.c b/boot/bootmeth_pxe.c
index 6e5e0f9..faa8d72 100644
--- a/boot/bootmeth_pxe.c
+++ b/boot/bootmeth_pxe.c
@@ -13,6 +13,7 @@
#include <bootmeth.h>
#include <command.h>
#include <dm.h>
+#include <env.h>
#include <extlinux.h>
#include <fs.h>
#include <log.h>
diff --git a/cmd/pxe.c b/cmd/pxe.c
index 0f26b3b..e82247a 100644
--- a/cmd/pxe.c
+++ b/cmd/pxe.c
@@ -5,6 +5,7 @@
*/
#include <command.h>
+#include <env.h>
#include <fs.h>
#include <net.h>
#include <net6.h>
diff --git a/drivers/net/pfe_eth/pfe_firmware.c b/drivers/net/pfe_eth/pfe_firmware.c
index da4f2ca..b821fb1 100644
--- a/drivers/net/pfe_eth/pfe_firmware.c
+++ b/drivers/net/pfe_eth/pfe_firmware.c
@@ -12,6 +12,7 @@
#include <dm.h>
#include <dm/device-internal.h>
+#include <env.h>
#include <image.h>
#include <log.h>
#include <malloc.h>
diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c
index c0df5cb..298149b 100644
--- a/lib/efi_loader/efi_bootmgr.c
+++ b/lib/efi_loader/efi_bootmgr.c
@@ -12,6 +12,7 @@
#include <charset.h>
#include <dm.h>
#include <efi.h>
+#include <env.h>
#include <log.h>
#include <malloc.h>
#include <net.h>
diff --git a/lib/efi_loader/efi_net.c b/lib/efi_loader/efi_net.c
index b3291b4..9db738e 100644
--- a/lib/efi_loader/efi_net.c
+++ b/lib/efi_loader/efi_net.c
@@ -18,6 +18,7 @@
#define LOG_CATEGORY LOGC_EFI
#include <efi_loader.h>
+#include <env.h>
#include <dm.h>
#include <linux/sizes.h>
#include <malloc.h>
diff --git a/net/lwip/dhcp.c b/net/lwip/dhcp.c
index 92bd706..043d2ab 100644
--- a/net/lwip/dhcp.c
+++ b/net/lwip/dhcp.c
@@ -3,6 +3,7 @@
#include <command.h>
#include <console.h>
+#include <env.h>
#include <log.h>
#include <dm/device.h>
#include <linux/delay.h>
diff --git a/net/lwip/dns.c b/net/lwip/dns.c
index 19172ac..6862869 100644
--- a/net/lwip/dns.c
+++ b/net/lwip/dns.c
@@ -3,6 +3,7 @@
#include <command.h>
#include <console.h>
+#include <env.h>
#include <lwip/dns.h>
#include <lwip/timeouts.h>
#include <net.h>
diff --git a/net/lwip/net-lwip.c b/net/lwip/net-lwip.c
index f05c4cd..abc52b3 100644
--- a/net/lwip/net-lwip.c
+++ b/net/lwip/net-lwip.c
@@ -3,6 +3,7 @@
/* Copyright (C) 2024 Linaro Ltd. */
#include <command.h>
+#include <env.h>
#include <dm/device.h>
#include <dm/uclass.h>
#include <hexdump.h>
diff --git a/net/lwip/tftp.c b/net/lwip/tftp.c
index 4f9b204..56d27f8 100644
--- a/net/lwip/tftp.c
+++ b/net/lwip/tftp.c
@@ -6,6 +6,7 @@
#include <display_options.h>
#include <dm/device.h>
#include <efi_loader.h>
+#include <env.h>
#include <image.h>
#include <linux/delay.h>
#include <lwip/apps/tftp_client.h>
diff --git a/net/lwip/wget.c b/net/lwip/wget.c
index a3b8290..46c16ed 100644
--- a/net/lwip/wget.c
+++ b/net/lwip/wget.c
@@ -5,6 +5,7 @@
#include <console.h>
#include <display_options.h>
#include <efi_loader.h>
+#include <env.h>
#include <image.h>
#include <lwip/apps/http_client.h>
#include "lwip/altcp_tls.h"
diff --git a/test/dm/dsa.c b/test/dm/dsa.c
index 9a31ae3..46e4874 100644
--- a/test/dm/dsa.c
+++ b/test/dm/dsa.c
@@ -3,6 +3,7 @@
* Copyright 2020-2021 NXP
*/
+#include <env.h>
#include <net/dsa.h>
#include <dm/test.h>
#include <test/ut.h>