From: Christoph Hellwig Date: Mon, 15 Apr 2019 09:14:42 +0000 (+0200) Subject: riscv: call pm_power_off from machine_halt / machine_power_off X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=bf0102a0fdd9fa2b41c2646c4f96e91b678de89e;p=openwrt%2Fstaging%2Fblogic.git riscv: call pm_power_off from machine_halt / machine_power_off This way any override of pm_power_off also affects the halt path and we don't need additional infrastructure for it. Also remove the pm_power_off export - at least for now we don't have any modular drivers overriding it. Signed-off-by: Christoph Hellwig Reviewed-by: Atish Patra Signed-off-by: Palmer Dabbelt --- diff --git a/arch/riscv/kernel/reset.c b/arch/riscv/kernel/reset.c index 2a53d26ffdd6..ed637aee514b 100644 --- a/arch/riscv/kernel/reset.c +++ b/arch/riscv/kernel/reset.c @@ -12,11 +12,15 @@ */ #include -#include #include -void (*pm_power_off)(void) = machine_power_off; -EXPORT_SYMBOL(pm_power_off); +static void default_power_off(void) +{ + sbi_shutdown(); + while (1); +} + +void (*pm_power_off)(void) = default_power_off; void machine_restart(char *cmd) { @@ -26,11 +30,10 @@ void machine_restart(char *cmd) void machine_halt(void) { - machine_power_off(); + pm_power_off(); } void machine_power_off(void) { - sbi_shutdown(); - while (1); + pm_power_off(); }