summaryrefslogtreecommitdiff
path: root/arch/xtensa/platforms/xt2000/setup.c
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2023-06-07 08:59:38 -0700
committerMax Filippov <jcmvbkbc@gmail.com>2023-06-12 19:48:56 -0700
commit7561dfbf3b3451957c5d3fc52f53c78e78ed3034 (patch)
tree9888ce0b5feae5969c04ebc2aaba66dda600bc82 /arch/xtensa/platforms/xt2000/setup.c
parent11976fe2a47aa952b8fec54bc2bd54d57642f650 (diff)
xtensa: drop platform_halt and platform_power_off
Instead of using xtensa-specific platform_halt and platform_power_off callbacks use do_kernel_power_off in the machine_halt and machine_power_off and reimplement existing platform_halt and platform_power_off users with register_sys_off_handler. Drop platform_halt and platform_power_off declarations and default implementations. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/platforms/xt2000/setup.c')
-rw-r--r--arch/xtensa/platforms/xt2000/setup.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/arch/xtensa/platforms/xt2000/setup.c b/arch/xtensa/platforms/xt2000/setup.c
index 71b57ab50599..258e01a51fd8 100644
--- a/arch/xtensa/platforms/xt2000/setup.c
+++ b/arch/xtensa/platforms/xt2000/setup.c
@@ -42,18 +42,12 @@ static void led_print (int f, char *s)
break;
}
-void platform_halt(void)
-{
- led_print (0, " HALT ");
- local_irq_disable();
- while (1);
-}
-
-void platform_power_off(void)
+static int xt2000_power_off(struct sys_off_data *unused)
{
led_print (0, "POWEROFF");
local_irq_disable();
while (1);
+ return NOTIFY_DONE;
}
static int xt2000_restart(struct notifier_block *this,
@@ -147,6 +141,9 @@ static int __init xt2000_setup_devinit(void)
platform_device_register(&xt2000_sonic_device);
mod_timer(&heartbeat_timer, jiffies + HZ / 2);
register_restart_handler(&xt2000_restart_block);
+ register_sys_off_handler(SYS_OFF_MODE_POWER_OFF,
+ SYS_OFF_PRIO_DEFAULT,
+ xt2000_power_off, NULL);
return 0;
}