Not all Rockchip SoC models use the ARM arch timer.
Call the function timer_init() only when
CONFIG_SYS_ARCH_TIMER is available.
Replace the ifdef call condition by IS_ENABLED
to increase build coverage and make the code easier to read.

Signed-off-by: Johan Jonker <jbx6...@gmail.com>
---
 arch/arm/mach-rockchip/spl.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-rockchip/spl.c b/arch/arm/mach-rockchip/spl.c
index 31558415..c1df6ce2 100644
--- a/arch/arm/mach-rockchip/spl.c
+++ b/arch/arm/mach-rockchip/spl.c
@@ -138,10 +138,10 @@ void board_init_f(ulong dummy)
        if (IS_ENABLED(CONFIG_ROCKCHIP_STIMER_BASE))
                rockchip_stimer_init();
 
-#ifdef CONFIG_SYS_ARCH_TIMER
-       /* Init ARM arch timer in arch/arm/cpu/armv7/arch_timer.c */
-       timer_init();
-#endif
+       /* Init ARM arch timer */
+       if (IS_ENABLED(CONFIG_SYS_ARCH_TIMER))
+               timer_init();
+
 #if !defined(CONFIG_TPL) || defined(CONFIG_SPL_RAM)
        debug("\nspl:init dram\n");
        ret = dram_init();
-- 
2.20.1

Reply via email to