On 3/19/25 4:28 AM, Marek Vasut wrote:
In case ENV_IS_IN_SPI_FLASH is disabled, returning ENVL_SPI_FLASH
leads to failure to find environment driver on start up. Fix this
by testing whether ENV_IS_IN_SPI_FLASH is enabled and if not, then
return ENVL_NOWHERE instead.

Signed-off-by: Marek Vasut <ma...@denx.de>
---
Cc: Christoph Niedermaier <cniederma...@dh-electronics.com>
Cc: Patrice Chotard <patrice.chot...@foss.st.com>
Cc: Tom Rini <tr...@konsulko.com>
Cc: u-b...@dh-electronics.com
Cc: u-boot@lists.denx.de
---
  board/dhelectronics/dh_imx8mp/imx8mp_dhcom_pdk2.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/board/dhelectronics/dh_imx8mp/imx8mp_dhcom_pdk2.c 
b/board/dhelectronics/dh_imx8mp/imx8mp_dhcom_pdk2.c
index 4af3cbe9fe2..4275436b128 100644
--- a/board/dhelectronics/dh_imx8mp/imx8mp_dhcom_pdk2.c
+++ b/board/dhelectronics/dh_imx8mp/imx8mp_dhcom_pdk2.c
@@ -186,5 +186,7 @@ int board_late_init(void)
enum env_location env_get_location(enum env_operation op, int prio)
  {
-       return prio ? ENVL_UNKNOWN : ENVL_SPI_FLASH;
+       return prio ? ENVL_UNKNOWN : CONFIG_IS_ENABLED(ENV_IS_IN_SPI_FLASH,
+                                                      (ENVL_SPI_FLASH),
+                                                      (ENVL_NOWHERE));
  }

+CC Fabio too ... hmmm, get maintainers is acting up a bit today.

Reply via email to