From: Andrew Davis <afd@ti.com>
To: Russell King <linux@armlinux.org.uk>, Arnd Bergmann <arnd@arndb.de>
Cc: <linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, Andrew Davis <afd@ti.com>
Subject: [PATCH] ARM: setup: Use register_sys_off_handler(SYS_OFF_MODE_RESTART)
Date: Wed, 13 Aug 2025 16:50:45 -0500 [thread overview]
Message-ID: <20250813215045.543957-1-afd@ti.com> (raw)
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>
---
arch/arm/kernel/setup.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 0bfd66c7ada05..8e21634109ef8 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -1081,18 +1081,12 @@ void __init hyp_mode_check(void)
static void (*__arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd);
-static int arm_restart(struct notifier_block *nb, unsigned long action,
- void *data)
+static int arm_restart(struct sys_off_data *data)
{
- __arm_pm_restart(action, data);
+ __arm_pm_restart(data->mode, data->cmd);
return NOTIFY_DONE;
}
-static struct notifier_block arm_restart_nb = {
- .notifier_call = arm_restart,
- .priority = 128,
-};
-
void __init setup_arch(char **cmdline_p)
{
const struct machine_desc *mdesc = NULL;
@@ -1160,7 +1154,7 @@ void __init setup_arch(char **cmdline_p)
if (mdesc->restart) {
__arm_pm_restart = mdesc->restart;
- register_restart_handler(&arm_restart_nb);
+ register_sys_off_handler(SYS_OFF_MODE_RESTART, 128, arm_restart, NULL);
}
unflatten_device_tree();
--
2.39.2
reply other threads:[~2025-08-13 22:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250813215045.543957-1-afd@ti.com \
--to=afd@ti.com \
--cc=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox