Skip to content

Commit 7a3595d

Browse files
glneojcmvbkbc
authored andcommitted
xtensa: xt2000: 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 <[email protected]> Message-ID: <[email protected]> Signed-off-by: Max Filippov <[email protected]>
1 parent a413a26 commit 7a3595d

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

  • arch/xtensa/platforms/xt2000

arch/xtensa/platforms/xt2000/setup.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ static int xt2000_power_off(struct sys_off_data *unused)
5050
return NOTIFY_DONE;
5151
}
5252

53-
static int xt2000_restart(struct notifier_block *this,
54-
unsigned long event, void *ptr)
53+
static int xt2000_restart(struct sys_off_data *unused)
5554
{
5655
/* Flush and reset the mmu, simulate a processor reset, and
5756
* jump to the reset vector. */
@@ -60,10 +59,6 @@ static int xt2000_restart(struct notifier_block *this,
6059
return NOTIFY_DONE;
6160
}
6261

63-
static struct notifier_block xt2000_restart_block = {
64-
.notifier_call = xt2000_restart,
65-
};
66-
6762
void __init platform_setup(char** cmdline)
6863
{
6964
led_print (0, "LINUX ");
@@ -140,7 +135,9 @@ static int __init xt2000_setup_devinit(void)
140135
platform_device_register(&xt2000_serial8250_device);
141136
platform_device_register(&xt2000_sonic_device);
142137
mod_timer(&heartbeat_timer, jiffies + HZ / 2);
143-
register_restart_handler(&xt2000_restart_block);
138+
register_sys_off_handler(SYS_OFF_MODE_RESTART,
139+
SYS_OFF_PRIO_PLATFORM,
140+
xt2000_restart, NULL);
144141
register_sys_off_handler(SYS_OFF_MODE_POWER_OFF,
145142
SYS_OFF_PRIO_DEFAULT,
146143
xt2000_power_off, NULL);

0 commit comments

Comments
 (0)