From bf0102a0fdd9fa2b41c2646c4f96e91b678de89e Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 15 Apr 2019 11:14:42 +0200 Subject: [PATCH] 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 --- arch/riscv/kernel/reset.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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(); }