]> git.baikalelectronics.ru Git - kernel.git/commitdiff
riscv: call pm_power_off from machine_halt / machine_power_off
authorChristoph Hellwig <hch@lst.de>
Mon, 15 Apr 2019 09:14:42 +0000 (11:14 +0200)
committerPalmer Dabbelt <palmer@sifive.com>
Thu, 25 Apr 2019 21:51:12 +0000 (14:51 -0700)
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 <hch@lst.de>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
arch/riscv/kernel/reset.c

index 2a53d26ffdd67f7062de4e0efbdc0a209cdf3597..ed637aee514b3a711c77201ba5f843ac90a7bc1c 100644 (file)
  */
 
 #include <linux/reboot.h>
-#include <linux/export.h>
 #include <asm/sbi.h>
 
-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();
 }