Skip to content

Commit 7d0ce3b

Browse files
Kefeng Wangpalmer-dabbelt
authored andcommitted
riscv: sbi: Fix undefined reference to sbi_shutdown
There is no shutdown call in SBI v0.2, only set pm_power_off when RISCV_SBI_V01 enabled to fix following build error, riscv64-linux-ld: arch/riscv/kernel/sbi.o: in function `sbi_power_off': sbi.c:(.text+0xe): undefined reference to `sbi_shutdown Fixes: efca139 ("RISC-V: Introduce a new config for SBI v0.1") Signed-off-by: Kefeng Wang <[email protected]> Reviewed-by: Anup Patel <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent f9d89c9 commit 7d0ce3b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

arch/riscv/kernel/sbi.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,11 @@ static int __sbi_rfence_v01(int fid, const unsigned long *hart_mask,
167167

168168
return result;
169169
}
170+
171+
static void sbi_set_power_off(void)
172+
{
173+
pm_power_off = sbi_shutdown;
174+
}
170175
#else
171176
static void __sbi_set_timer_v01(uint64_t stime_value)
172177
{
@@ -191,6 +196,8 @@ static int __sbi_rfence_v01(int fid, const unsigned long *hart_mask,
191196

192197
return 0;
193198
}
199+
200+
static void sbi_set_power_off(void) {}
194201
#endif /* CONFIG_RISCV_SBI_V01 */
195202

196203
static void __sbi_set_timer_v02(uint64_t stime_value)
@@ -540,16 +547,12 @@ static inline long sbi_get_firmware_version(void)
540547
return __sbi_base_ecall(SBI_EXT_BASE_GET_IMP_VERSION);
541548
}
542549

543-
static void sbi_power_off(void)
544-
{
545-
sbi_shutdown();
546-
}
547550

548551
int __init sbi_init(void)
549552
{
550553
int ret;
551554

552-
pm_power_off = sbi_power_off;
555+
sbi_set_power_off();
553556
ret = sbi_get_spec_version();
554557
if (ret > 0)
555558
sbi_spec_version = ret;

0 commit comments

Comments
 (0)