summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Phillips <kim.phillips@freescale.com>2007-07-17 13:57:04 -0500
committerGerald Van Baren <vanbaren@cideas.com>2007-08-10 19:21:37 -0400
commit99dffca3b7590a16a00bc475c860b67b2a3f1462 (patch)
treed486d6730abfe03495b539a2fc75886654d5430b
parent91148bf7aeba142d6f348805db7625db7da64d6f (diff)
downloadu-boot-imx-99dffca3b7590a16a00bc475c860b67b2a3f1462.zip
u-boot-imx-99dffca3b7590a16a00bc475c860b67b2a3f1462.tar.gz
u-boot-imx-99dffca3b7590a16a00bc475c860b67b2a3f1462.tar.bz2
fdt: allow for builds that don't want env and bd_t nodes
protect fdt_env and fdt_bd_t invocations, fix codingstyle while in the area. Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
-rw-r--r--common/cmd_fdt.c38
1 files changed, 15 insertions, 23 deletions
diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c
index 9ddec47..571b8f1 100644
--- a/common/cmd_fdt.c
+++ b/common/cmd_fdt.c
@@ -293,36 +293,28 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
return err;
}
}
-
+ }
#ifdef CONFIG_OF_BOARD_SETUP
- /********************************************************************
- * Call the board-specific fixup routine
- ********************************************************************/
- } else if (argv[1][0] == 'b') {
+ /* Call the board-specific fixup routine */
+ else if (argv[1][0] == 'b')
ft_board_setup(fdt, gd->bd);
#endif
- /********************************************************************
- * Create a chosen node
- ********************************************************************/
- } else if (argv[1][0] == 'c') {
+ /* Create a chosen node */
+ else if (argv[1][0] == 'c')
fdt_chosen(fdt, 0, 0, 1);
- /********************************************************************
- * Create a u-boot-env node
- ********************************************************************/
- } else if (argv[1][0] == 'e') {
+#ifdef CONFIG_OF_HAS_UBOOT_ENV
+ /* Create a u-boot-env node */
+ else if (argv[1][0] == 'e')
fdt_env(fdt);
-
- /********************************************************************
- * Create a bd_t node
- ********************************************************************/
- } else if (argv[1][0] == 'b') {
+#endif
+#ifdef CONFIG_OF_HAS_BD_T
+ /* Create a bd_t node */
+ else if (argv[1][0] == 'b')
fdt_bd_t(fdt);
-
- /********************************************************************
- * Unrecognized command
- ********************************************************************/
- } else {
+#endif
+ else {
+ /* Unrecognized command */
printf ("Usage:\n%s\n", cmdtp->usage);
return 1;
}