[U-Boot] [PATCH 2/2] env_mmc: default to 0 if CONFIG_SYS_MMC_ENV_DEV not defined

Stephen Warren swarren at wwwdotorg.org
Wed Jan 15 18:40:29 CET 2014


On 01/15/2014 03:53 AM, Hector Palacios wrote:
> Since function mmc_get_env_devno is __weak and can be overridden by
> board code, boards do not necessarily need to define
> CONFIG_SYS_MMC_ENV_DEV. If the constant is not defined, return 0 by
> default.

Ah, I see that's a better justification for allowing the define not to
be set.


> diff --git a/common/env_mmc.c b/common/env_mmc.c

>  __weak int mmc_get_env_devno(void)
>  {
> +#ifdef CONFIG_SYS_MMC_ENV_DEV
>  	return CONFIG_SYS_MMC_ENV_DEV;
> +#endif

Same comment here; need a #else here, and #endif below.
> +	return 0;
> +}

Re: Hector's comments: Perhaps the following in
include/config_fallbacks.h would be appropriate?

#ifndef CONFIG_SYS_MMC_ENV_DEV
#define CONFIG_SYS_MMC_ENV_DEV 0
#endif

?


More information about the U-Boot mailing list