summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Davis <afd@ti.com>2026-03-02 13:35:43 -0600
committerMax Filippov <jcmvbkbc@gmail.com>2026-03-03 12:03:10 -0800
commit89355b05356d055fc5a7bc0fdffd44cb4a53f477 (patch)
tree336a463f079be67ea284d4a33c5a5e1aa8531220
parent7a3595dfffb84f7ff3d8e2800b271d02d2933d04 (diff)
xtensa: xtfpga: Use register_sys_off_handler(SYS_OFF_MODE_RESTART)
Function register_restart_handler() is deprecated. Using this new API removes our need to keep and manage a struct notifier_block. Signed-off-by: Andrew Davis <afd@ti.com> Message-ID: <20260302193543.275197-3-afd@ti.com> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
-rw-r--r--arch/xtensa/platforms/xtfpga/setup.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/arch/xtensa/platforms/xtfpga/setup.c b/arch/xtensa/platforms/xtfpga/setup.c
index a2432f081710..67d7f37f1802 100644
--- a/arch/xtensa/platforms/xtfpga/setup.c
+++ b/arch/xtensa/platforms/xtfpga/setup.c
@@ -42,8 +42,7 @@ static int xtfpga_power_off(struct sys_off_data *unused)
return NOTIFY_DONE;
}
-static int xtfpga_restart(struct notifier_block *this,
- unsigned long event, void *ptr)
+static int xtfpga_restart(struct sys_off_data *unused)
{
/* Try software reset first. */
WRITE_ONCE(*(u32 *)XTFPGA_SWRST_VADDR, 0xdead);
@@ -56,10 +55,6 @@ static int xtfpga_restart(struct notifier_block *this,
return NOTIFY_DONE;
}
-static struct notifier_block xtfpga_restart_block = {
- .notifier_call = xtfpga_restart,
-};
-
#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
void __init platform_calibrate_ccount(void)
@@ -71,7 +66,9 @@ void __init platform_calibrate_ccount(void)
static void __init xtfpga_register_handlers(void)
{
- register_restart_handler(&xtfpga_restart_block);
+ register_sys_off_handler(SYS_OFF_MODE_RESTART,
+ SYS_OFF_PRIO_PLATFORM,
+ xtfpga_restart, NULL);
register_sys_off_handler(SYS_OFF_MODE_POWER_OFF,
SYS_OFF_PRIO_DEFAULT,
xtfpga_power_off, NULL);