[U-Boot] [PATCH V3 06/14] ARM: tegra: only build __pinmux_nand() when it's needed

Stephen Warren swarren at wwwdotorg.org
Fri Jan 24 20:46:11 CET 2014


From: Tom Warren <twarren.nvidia at gmail.com>

__pinmux_nand() won't compile if PERIPH_ID_NDFLASH isn't defined.
Prevent this from causing build problems on newer SoCs without NAND
support (or without SW support for NAND yet), but preventing
compilation unless the function will actually be used, i.e. when
CONFIG_TEGRA_NAND is defined.

Signed-off-by: Tom Warren <twarren at nvidia.com>
[swarren, rewrote commit description, moved ifdef around whole function
rather than just body]
Signed-off-by: Stephen Warren <swarren at nvidia.com>
Tested-by: Thierry Reding <treding at nvidia.com>
---
v2:
* Fixed TODO by moving the ifdef around the whole function rather than
  being inside the function body. The call to the function is under the
  same ifdef.
---
 board/nvidia/common/board.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index 1972527e7d11..aa42c69f904e 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -78,12 +78,14 @@ void __gpio_early_init_uart(void)
 void gpio_early_init_uart(void)
 __attribute__((weak, alias("__gpio_early_init_uart")));
 
+#if defined(CONFIG_TEGRA_NAND)
 void __pin_mux_nand(void)
 {
 	funcmux_select(PERIPH_ID_NDFLASH, FUNCMUX_DEFAULT);
 }
 
 void pin_mux_nand(void) __attribute__((weak, alias("__pin_mux_nand")));
+#endif
 
 void __pin_mux_display(void)
 {
-- 
1.8.1.5



More information about the U-Boot mailing list