Skip to content

Commit 89355b0

Browse files
glneojcmvbkbc
authored andcommitted
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>
1 parent 7a3595d commit 89355b0

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

  • arch/xtensa/platforms/xtfpga

arch/xtensa/platforms/xtfpga/setup.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ static int xtfpga_power_off(struct sys_off_data *unused)
4242
return NOTIFY_DONE;
4343
}
4444

45-
static int xtfpga_restart(struct notifier_block *this,
46-
unsigned long event, void *ptr)
45+
static int xtfpga_restart(struct sys_off_data *unused)
4746
{
4847
/* Try software reset first. */
4948
WRITE_ONCE(*(u32 *)XTFPGA_SWRST_VADDR, 0xdead);
@@ -56,10 +55,6 @@ static int xtfpga_restart(struct notifier_block *this,
5655
return NOTIFY_DONE;
5756
}
5857

59-
static struct notifier_block xtfpga_restart_block = {
60-
.notifier_call = xtfpga_restart,
61-
};
62-
6358
#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
6459

6560
void __init platform_calibrate_ccount(void)
@@ -71,7 +66,9 @@ void __init platform_calibrate_ccount(void)
7166

7267
static void __init xtfpga_register_handlers(void)
7368
{
74-
register_restart_handler(&xtfpga_restart_block);
69+
register_sys_off_handler(SYS_OFF_MODE_RESTART,
70+
SYS_OFF_PRIO_PLATFORM,
71+
xtfpga_restart, NULL);
7572
register_sys_off_handler(SYS_OFF_MODE_POWER_OFF,
7673
SYS_OFF_PRIO_DEFAULT,
7774
xtfpga_power_off, NULL);

0 commit comments

Comments
 (0)