From: Michal Simek Date: Thu, 17 Jul 2025 06:26:15 +0000 (+0200) Subject: riscv: cpu: Use CONFIG_IS_ENABLED(CPU) instead of plain ifdef X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c64fc632a86a58e343cb3f181cd8d5642a28894a;p=pandora-u-boot.git riscv: cpu: Use CONFIG_IS_ENABLED(CPU) instead of plain ifdef ifdef CONFIG_CPU only works in U-Boot proper but macro is not working when XPL phases are used. In this case CONFIG_SPL_CPU is also defined and can be disabled which is causing compilation error. Signed-off-by: Michal Simek Reviewed-by: Leo Yu-Chi Liang --- diff --git a/arch/riscv/cpu/cpu.c b/arch/riscv/cpu/cpu.c index 15c4e14599d..d5123e4b7d9 100644 --- a/arch/riscv/cpu/cpu.c +++ b/arch/riscv/cpu/cpu.c @@ -608,14 +608,14 @@ static inline bool supports_extension(char ext) static int riscv_cpu_probe(void) { -#ifdef CONFIG_CPU - int ret; + if (CONFIG_IS_ENABLED(CPU)) { + int ret; - /* probe cpus so that RISC-V timer can be bound */ - ret = cpu_probe_all(); - if (ret) - return log_msg_ret("RISC-V cpus probe failed\n", ret); -#endif + /* probe cpus so that RISC-V timer can be bound */ + ret = cpu_probe_all(); + if (ret) + return log_msg_ret("RISC-V cpus probe failed\n", ret); + } return 0; }