diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c index 515b5a662706..20470e5a7d3c 100644 --- a/arch/riscv/kernel/setup.c +++ b/arch/riscv/kernel/setup.c @@ -249,6 +249,9 @@ void __init setup_arch(char **cmdline_p) pr_err("No DTB found in kernel mappings\n"); #endif + if (IS_ENABLED(CONFIG_RISCV_SBI)) + sbi_init(); + #ifdef CONFIG_SWIOTLB swiotlb_init(1); #endif @@ -257,10 +260,6 @@ void __init setup_arch(char **cmdline_p) kasan_init(); #endif -#if IS_ENABLED(CONFIG_RISCV_SBI) - sbi_init(); -#endif - #ifdef CONFIG_SMP setup_smp(); #endif