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

Sinthu Raja sinthu.raja at mistralsolutions.com
Tue Nov 2 15:05:45 CET 2021


From: Sinthu Raja <sinthu.raja at 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: Sinthu Raja <sinthu.raja at ti.com>
---

No chnages in V2.

 board/ti/j721e/evm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c
index 077d83420c..9cdb963221 100644
--- a/board/ti/j721e/evm.c
+++ b/board/ti/j721e/evm.c
@@ -172,6 +172,7 @@ int checkboard(void)
 	return 0;
 }
 
+#ifdef CONFIG_BOARD_LATE_INIT
 static void setup_board_eeprom_env(void)
 {
 	char *name = "j721e";
@@ -210,6 +211,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
@@ -413,6 +415,7 @@ void configure_serdes_torrent(void)
 		printf("phy_power_on failed !!\n");
 }
 
+#ifdef CONFIG_BOARD_LATE_INIT
 int board_late_init(void)
 {
 	if (IS_ENABLED(CONFIG_TI_I2C_BOARD_DETECT)) {
@@ -428,6 +431,7 @@ int board_late_init(void)
 
 	return 0;
 }
+#endif
 
 void spl_board_init(void)
 {
-- 
2.31.1



More information about the U-Boot mailing list