Patchwork [U-Boot,v2,2/3] common/cmd_nand.c: add ifdef protection for do_bootm

login
register
mail settings
Submitter Matthew McClintock
Date May 24, 2011, 3:47 p.m.
Message ID <1306252059-26770-1-git-send-email-msm@freescale.com>
Download mbox | patch
Permalink /patch/97176/
State Superseded
Headers show

Comments

Matthew McClintock - May 24, 2011, 3:47 p.m.
Right now we do not check if do_bootm is actually built into this
u-boot. Instead check define and only call do_bootm if it's actually
available.

Signed-off-by: Matthew McClintock <msm@freescale.com>
---
v2: Add ifdef protect for the whole autostart/autoboot block as it's not
    supported when the bootm command is not available

 common/cmd_nand.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Patch

diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index 7bd37de..8fa5d3f 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -799,6 +799,7 @@  static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,
 
 	load_addr = addr;
 
+#ifdef CONFIG_CMD_BOOTM
 	/* Check if we should attempt an auto-start */
 	if (((ep = getenv("autostart")) != NULL) && (strcmp(ep, "yes") == 0)) {
 		char *local_args[2];
@@ -811,6 +812,7 @@  static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,
 		do_bootm(cmdtp, 0, 1, local_args);
 		return 1;
 	}
+#endif
 	return 0;
 }