]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: stm32mp1: solve compilation issue when ENV_IS_IN_MMC is deactivated
authorPatrick Delaunay <patrick.delaunay@foss.st.com>
Tue, 11 Jan 2022 15:37:21 +0000 (16:37 +0100)
committerPatrice Chotard <patrice.chotard@foss.st.com>
Mon, 24 Jan 2022 10:00:47 +0000 (11:00 +0100)
Solve compilation issue on undefined CONFIG_SYS_MMC_ENV_DEV when
CONFIG_ENV_IS_IN_MMC is deactivated on STMicroelectronics boards
defconfig

Fixes: 9f97193616f1 ("board: stm32mp1: use CONFIG_SYS_MMC_ENV_DEV when available")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
board/st/stm32mp1/stm32mp1.c

index 45f2ca81a64f7e032351b232954b0f79addde0f2..fff1880e5b03b850da4415ef27c6a154679dd243 100644 (file)
@@ -890,8 +890,10 @@ const char *env_ext4_get_dev_part(void)
 
 int mmc_get_env_dev(void)
 {
-       if (CONFIG_SYS_MMC_ENV_DEV >= 0)
-               return CONFIG_SYS_MMC_ENV_DEV;
+       const int mmc_env_dev = CONFIG_IS_ENABLED(ENV_IS_IN_MMC, (CONFIG_SYS_MMC_ENV_DEV), (-1));
+
+       if (mmc_env_dev >= 0)
+               return mmc_env_dev;
 
        /* use boot instance to select the correct mmc device identifier */
        return mmc_get_boot();