[U-Boot] [PATCH 1/8] sunxi: Only compile board_nand_init() if CONFIG_NAND is set

Chen-Yu Tsai wens at csie.org
Thu May 28 15:25:27 CEST 2015


There's no need to init NAND if we're not building with NAND support.
Wrap board_nand_init() in #ifdefs like we do for board_mmc_init().
This fixes build breaks for sun6i and sun9i. Both platforms do not
have CONFIG_NAND_SUNXI_GPC_PORTS defined.

Fixes: fbf13d684dcb ("sunxi/nand: Add support to the SPL for loading u-boot
		      from internal NAND memory")
Signed-off-by: Chen-Yu Tsai <wens at csie.org>
---
 board/sunxi/board.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 3f23f26..f27967b 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -318,6 +318,7 @@ int board_mmc_init(bd_t *bis)
 }
 #endif
 
+#ifdef CONFIG_NAND
 void board_nand_init(void)
 {
 	unsigned int pin;
@@ -330,6 +331,7 @@ void board_nand_init(void)
 	for (pin = 0; pin < ARRAY_SIZE(ports); pin++)
 		sunxi_gpio_set_cfgpin(SUNXI_GPC(ports[pin]), SUNXI_GPC_NAND);
 }
+#endif
 
 void i2c_init_board(void)
 {
-- 
2.1.4



More information about the U-Boot mailing list