mirror of
https://github.com/torvalds/linux.git
synced 2024-12-21 10:31:54 +00:00
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 <hch@lst.de> Reviewed-by: Atish Patra <atish.patra@wdc.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
This commit is contained in:
parent
bed1378706
commit
bf0102a0fd
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user