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

login
register
mail settings
Submitter Matthew McClintock
Date May 23, 2011, 6:29 p.m.
Message ID <1306175353-2983-2-git-send-email-msm@freescale.com>
Download mbox | patch
Permalink /patch/97023/
State Superseded
Headers show

Comments

Matthew McClintock - May 23, 2011, 6:29 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>
---
 common/cmd_nand.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Mike Frysinger - May 24, 2011, 3:12 a.m.
On Monday, May 23, 2011 14:29:12 Matthew McClintock wrote:
> 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.

basic idea is sound ...

> --- a/common/cmd_nand.c
> +++ b/common/cmd_nand.c
> @@ -806,9 +806,11 @@
>  		local_args[0] = cmd;
>  		local_args[1] = NULL;
> 
> +#ifdef	CONFIG_CMD_BOOTM
>  		printf("Automatic boot of image at addr 0x%08lx ...\n", addr);
> 
>  		do_bootm(cmdtp, 0, 1, local_args);
> +#endif
>  		return 1;
>  	}
>  	return 0;

there should be a space after the "#ifdef", not a tab.  and the ifdef should 
be around the local_args[] too.
-mike

Patch

diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index 7bd37de..44161da 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -806,9 +806,11 @@  static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,
 		local_args[0] = cmd;
 		local_args[1] = NULL;
 
+#ifdef	CONFIG_CMD_BOOTM
 		printf("Automatic boot of image at addr 0x%08lx ...\n", addr);
 
 		do_bootm(cmdtp, 0, 1, local_args);
+#endif
 		return 1;
 	}
 	return 0;