board_r: env: Use IS_ENABLED() instead of #ifdefs
Use IS_ENABLED() instead of #ifdef in should_load_env and initr_env functions. No functional change intended. Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
This commit is contained in:
parent
b8879f2074
commit
9441f8cbfe
1 changed files with 11 additions and 10 deletions
|
@ -464,13 +464,14 @@ static int initr_mmc(void)
|
||||||
*/
|
*/
|
||||||
static int should_load_env(void)
|
static int should_load_env(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_OF_CONTROL
|
if (IS_ENABLED(CONFIG_OF_CONTROL))
|
||||||
return fdtdec_get_config_int(gd->fdt_blob, "load-environment", 1);
|
return fdtdec_get_config_int(gd->fdt_blob,
|
||||||
#elif defined CONFIG_DELAY_ENVIRONMENT
|
"load-environment", 1);
|
||||||
return 0;
|
|
||||||
#else
|
if (IS_ENABLED(CONFIG_DELAY_ENVIRONMENT))
|
||||||
|
return 0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int initr_env(void)
|
static int initr_env(void)
|
||||||
|
@ -480,10 +481,10 @@ static int initr_env(void)
|
||||||
env_relocate();
|
env_relocate();
|
||||||
else
|
else
|
||||||
env_set_default(NULL, 0);
|
env_set_default(NULL, 0);
|
||||||
#ifdef CONFIG_OF_CONTROL
|
|
||||||
env_set_hex("fdtcontroladdr",
|
if (IS_ENABLED(CONFIG_OF_CONTROL))
|
||||||
(unsigned long)map_to_sysmem(gd->fdt_blob));
|
env_set_hex("fdtcontroladdr",
|
||||||
#endif
|
(unsigned long)map_to_sysmem(gd->fdt_blob));
|
||||||
|
|
||||||
/* Initialize from environment */
|
/* Initialize from environment */
|
||||||
image_load_addr = env_get_ulong("loadaddr", 16, image_load_addr);
|
image_load_addr = env_get_ulong("loadaddr", 16, image_load_addr);
|
||||||
|
|
Loading…
Reference in a new issue