From c992040003b0e5554c041b93ba3b03c7ea82e674 Mon Sep 17 00:00:00 2001 From: The Cheaterman Date: Wed, 5 Oct 2022 15:50:12 +0200 Subject: [PATCH] Use restart_handlers instead of arm_pm_restart in odroid-reboot --- drivers/power/reset/odroid-reboot.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/power/reset/odroid-reboot.c b/drivers/power/reset/odroid-reboot.c index 68092141fbbbb5..ab81bdde09efae 100644 --- a/drivers/power/reset/odroid-reboot.c +++ b/drivers/power/reset/odroid-reboot.c @@ -115,13 +115,19 @@ void odroid_card_reset(void) } } -static void do_odroid_restart(enum reboot_mode reboot_mode, const char *cmd) +static int do_odroid_restart(struct notifier_block *this, unsigned long mode, void *cmd) { odroid_card_reset(); __invoke_psci_fn_smc(psci_function_id_restart, 0, 0, 0); + return NOTIFY_DONE; } +static struct notifier_block odroid_restart_handler = { + .notifier_call = do_odroid_restart, + .priority = 127, +}; + static void do_odroid_poweroff(void) { odroid_card_reset(); @@ -138,7 +144,7 @@ static int odroid_restart_probe(struct platform_device *pdev) if (!of_property_read_u32(pdev->dev.of_node, "sys_reset", &id)) { psci_function_id_restart = id; - arm_pm_restart = do_odroid_restart; + register_restart_handler(&odroid_restart_handler); } if (!of_property_read_u32(pdev->dev.of_node, "sys_poweroff", &id)) {