Unverified Commit bf0102a0 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Palmer Dabbelt
Browse files

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarAtish Patra <atish.patra@wdc.com>
Signed-off-by: default avatarPalmer Dabbelt <palmer@sifive.com>
parent bed13787
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -12,11 +12,15 @@
 */

#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();
}