[PATCH v3 05/38] spl: Drop #ifdefs for BOARD_INIT and watchdog

Simon Glass sjg at chromium.org
Sun Sep 24 21:24:50 CEST 2023


Avoid using the preprocessor for these checks.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

(no changes since v1)

 common/spl/spl.c | 10 ++++------
 include/spl.h    |  8 ++++++--
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 4233390d7de2..68e58c930c28 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -782,13 +782,11 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
 		}
 	}
 
-#if CONFIG_IS_ENABLED(BOARD_INIT)
-	spl_board_init();
-#endif
+	if (CONFIG_IS_ENABLED(BOARD_INIT))
+		spl_board_init();
 
-#if defined(CONFIG_SPL_WATCHDOG) && CONFIG_IS_ENABLED(WDT)
-	initr_watchdog();
-#endif
+	if (IS_ENABLED(CONFIG_SPL_WATCHDOG) && CONFIG_IS_ENABLED(WDT))
+		initr_watchdog();
 
 	if (IS_ENABLED(CONFIG_SPL_OS_BOOT) || CONFIG_IS_ENABLED(HANDOFF) ||
 	    IS_ENABLED(CONFIG_SPL_ATF))
diff --git a/include/spl.h b/include/spl.h
index 92bcaa90a4af..d16cea3ea50b 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -707,9 +707,13 @@ int spl_early_init(void);
  */
 int spl_init(void);
 
-#ifdef CONFIG_SPL_BOARD_INIT
+/*
+ * spl_board_init() - Do board-specific init in SPL
+ *
+ * If xPL_BOARD_INIT is enabled, this is called from board_init_r() before
+ * jumping to the next phase.
+ */
 void spl_board_init(void);
-#endif
 
 /**
  * spl_was_boot_source() - check if U-Boot booted from SPL
-- 
2.42.0.515.g380fc7ccd1-goog



More information about the U-Boot mailing list