diff mbox series

[04/17] board: ti: j721e: Guard functions with right #ifdef to avoid build warnings

Message ID 20210626145602.15702-5-sinthu.raja@ti.com
State Changes Requested
Delegated to: Lokesh Vutla
Headers show
Series arm: k3-j721e: Add support for J721E EAIK | expand

Commit Message

Sinthu Raja June 26, 2021, 2:55 p.m. UTC
From: Amarnath MB <amarnath.mb@ti.com>

board_late_init(), setup_board_eeprom_env() and setup_serial() is
called only under CONFIG_BOARD_LATE_INIT, so guard these functions
with the same.

Signed-off-by: Amarnath MB <amarnath.mb@ti.com>
Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
---
 board/ti/j721e/evm.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c
index b9a9f19552..23e739bcd3 100644
--- a/board/ti/j721e/evm.c
+++ b/board/ti/j721e/evm.c
@@ -170,6 +170,7 @@  int checkboard(void)
 	return 0;
 }
 
+#ifdef CONFIG_BOARD_LATE_INIT
 static void setup_board_eeprom_env(void)
 {
 	char *name = "j721e";
@@ -208,6 +209,7 @@  static void setup_serial(void)
 	snprintf(serial_string, sizeof(serial_string), "%016lx", board_serial);
 	env_set("serial#", serial_string);
 }
+#endif
 
 /*
  * Declaration of daughtercards to probe. Note that when adding more
@@ -384,6 +386,7 @@  static int probe_daughtercards(void)
 }
 #endif
 
+#ifdef CONFIG_BOARD_LATE_INIT
 int board_late_init(void)
 {
 	if (IS_ENABLED(CONFIG_TI_I2C_BOARD_DETECT)) {
@@ -396,6 +399,7 @@  int board_late_init(void)
 
 	return 0;
 }
+#endif
 
 void spl_board_init(void)
 {