mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 00:32:04 +02:00
autoboot: Move a few more options from #ifdef to if()
Adjust some of the code which can be trivially moved to use IS_ENABLED() instead of #ifdef. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -292,7 +292,7 @@ static int abortboot(int bootdelay)
|
|||||||
|
|
||||||
static void process_fdt_options(const void *blob)
|
static void process_fdt_options(const void *blob)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_OF_CONTROL) && defined(CONFIG_SYS_TEXT_BASE)
|
#ifdef CONFIG_SYS_TEXT_BASE
|
||||||
ulong addr;
|
ulong addr;
|
||||||
|
|
||||||
/* Add an env variable to point to a kernel payload, if available */
|
/* Add an env variable to point to a kernel payload, if available */
|
||||||
@@ -304,7 +304,7 @@ static void process_fdt_options(const void *blob)
|
|||||||
addr = fdtdec_get_config_int(gd->fdt_blob, "rootdisk-offset", 0);
|
addr = fdtdec_get_config_int(gd->fdt_blob, "rootdisk-offset", 0);
|
||||||
if (addr)
|
if (addr)
|
||||||
env_set_addr("rootaddr", (void *)(CONFIG_SYS_TEXT_BASE + addr));
|
env_set_addr("rootaddr", (void *)(CONFIG_SYS_TEXT_BASE + addr));
|
||||||
#endif /* CONFIG_OF_CONTROL && CONFIG_SYS_TEXT_BASE */
|
#endif /* CONFIG_SYS_TEXT_BASE */
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *bootdelay_process(void)
|
const char *bootdelay_process(void)
|
||||||
@@ -317,16 +317,14 @@ const char *bootdelay_process(void)
|
|||||||
s = env_get("bootdelay");
|
s = env_get("bootdelay");
|
||||||
bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY;
|
bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY;
|
||||||
|
|
||||||
#ifdef CONFIG_OF_CONTROL
|
if (IS_ENABLED(CONFIG_OF_CONTROL))
|
||||||
bootdelay = fdtdec_get_config_int(gd->fdt_blob, "bootdelay",
|
bootdelay = fdtdec_get_config_int(gd->fdt_blob, "bootdelay",
|
||||||
bootdelay);
|
bootdelay);
|
||||||
#endif
|
|
||||||
|
|
||||||
debug("### main_loop entered: bootdelay=%d\n\n", bootdelay);
|
debug("### main_loop entered: bootdelay=%d\n\n", bootdelay);
|
||||||
|
|
||||||
#if defined(CONFIG_AUTOBOOT_MENU_SHOW)
|
if (IS_ENABLED(CONFIG_AUTOBOOT_MENU_SHOW))
|
||||||
bootdelay = menu_show(bootdelay);
|
bootdelay = menu_show(bootdelay);
|
||||||
#endif
|
|
||||||
bootretry_init_cmd_timeout();
|
bootretry_init_cmd_timeout();
|
||||||
|
|
||||||
#ifdef CONFIG_POST
|
#ifdef CONFIG_POST
|
||||||
@@ -339,7 +337,8 @@ const char *bootdelay_process(void)
|
|||||||
else
|
else
|
||||||
s = env_get("bootcmd");
|
s = env_get("bootcmd");
|
||||||
|
|
||||||
process_fdt_options(gd->fdt_blob);
|
if (IS_ENABLED(CONFIG_OF_CONTROL))
|
||||||
|
process_fdt_options(gd->fdt_blob);
|
||||||
stored_bootdelay = bootdelay;
|
stored_bootdelay = bootdelay;
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
|
Reference in New Issue
Block a user