diff mbox series

board: stm32mp1: solve compilation issue when ENV_IS_IN_MMC is deactivated

Message ID 20220111163714.1.Ied2e1c9b4790072658cbab4515ba8933878ce029@changeid
State Accepted
Commit 046bdb806407976cabce77eb304bb29fa70180f0
Delegated to: Patrice Chotard
Headers show
Series board: stm32mp1: solve compilation issue when ENV_IS_IN_MMC is deactivated | expand

Commit Message

Patrick DELAUNAY Jan. 11, 2022, 3:37 p.m. UTC
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>
---

 board/st/stm32mp1/stm32mp1.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Patrice CHOTARD Jan. 14, 2022, 2:35 p.m. UTC | #1
Hi Patrick

On 1/11/22 4:37 PM, Patrick Delaunay wrote:
> 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>
> ---
> 
>  board/st/stm32mp1/stm32mp1.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c
> index 45f2ca81a6..fff1880e5b 100644
> --- a/board/st/stm32mp1/stm32mp1.c
> +++ b/board/st/stm32mp1/stm32mp1.c
> @@ -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();
> 

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Thanks
Patrice
Patrice CHOTARD Jan. 24, 2022, 12:17 p.m. UTC | #2
Hi Patrick

On 1/11/22 16:37, Patrick Delaunay wrote:
> 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>
> ---
> 
>  board/st/stm32mp1/stm32mp1.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c
> index 45f2ca81a6..fff1880e5b 100644
> --- a/board/st/stm32mp1/stm32mp1.c
> +++ b/board/st/stm32mp1/stm32mp1.c
> @@ -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();
Applied to u-boot-stm/master

Thanks
Patrice
diff mbox series

Patch

diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c
index 45f2ca81a6..fff1880e5b 100644
--- a/board/st/stm32mp1/stm32mp1.c
+++ b/board/st/stm32mp1/stm32mp1.c
@@ -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();