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 <michal.simek@amd.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
This commit is contained in:
Michal Simek
2025-07-17 08:26:15 +02:00
committed by Leo Yu-Chi Liang
parent 869217ee29
commit c64fc632a8

View File

@@ -608,14 +608,14 @@ static inline bool supports_extension(char ext)
static int riscv_cpu_probe(void) static int riscv_cpu_probe(void)
{ {
#ifdef CONFIG_CPU if (CONFIG_IS_ENABLED(CPU)) {
int ret; int ret;
/* probe cpus so that RISC-V timer can be bound */ /* probe cpus so that RISC-V timer can be bound */
ret = cpu_probe_all(); ret = cpu_probe_all();
if (ret) if (ret)
return log_msg_ret("RISC-V cpus probe failed\n", ret); return log_msg_ret("RISC-V cpus probe failed\n", ret);
#endif }
return 0; return 0;
} }