public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] power: reset: keystone: Use register_sys_off_handler(SYS_OFF_MODE_RESTART)
@ 2026-03-02 19:33 Andrew Davis
  2026-03-02 23:07 ` Sebastian Reichel
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Davis @ 2026-03-02 19:33 UTC (permalink / raw)
  To: Santosh Shilimkar, Sebastian Reichel; +Cc: linux-kernel, linux-pm, Andrew Davis

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>
---
 drivers/power/reset/keystone-reset.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/power/reset/keystone-reset.c b/drivers/power/reset/keystone-reset.c
index d9268d150e1f9..b016f016cbd84 100644
--- a/drivers/power/reset/keystone-reset.c
+++ b/drivers/power/reset/keystone-reset.c
@@ -48,8 +48,7 @@ static inline int rsctrl_enable_rspll_write(void)
 				  RSCTRL_KEY_MASK, RSCTRL_KEY);
 }
 
-static int rsctrl_restart_handler(struct notifier_block *this,
-				  unsigned long mode, void *cmd)
+static int rsctrl_restart_handler(struct sys_off_data *data)
 {
 	/* enable write access to RSTCTRL */
 	rsctrl_enable_rspll_write();
@@ -61,11 +60,6 @@ static int rsctrl_restart_handler(struct notifier_block *this,
 	return NOTIFY_DONE;
 }
 
-static struct notifier_block rsctrl_restart_nb = {
-	.notifier_call = rsctrl_restart_handler,
-	.priority = 128,
-};
-
 static const struct of_device_id rsctrl_of_match[] = {
 	{.compatible = "ti,keystone-reset", },
 	{},
@@ -140,7 +134,8 @@ static int rsctrl_probe(struct platform_device *pdev)
 			return ret;
 	}
 
-	ret = register_restart_handler(&rsctrl_restart_nb);
+	ret = register_sys_off_handler(SYS_OFF_MODE_RESTART, 128,
+				       rsctrl_restart_handler, NULL);
 	if (ret)
 		dev_err(dev, "cannot register restart handler (err=%d)\n", ret);
 
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] power: reset: keystone: Use register_sys_off_handler(SYS_OFF_MODE_RESTART)
  2026-03-02 19:33 [PATCH] power: reset: keystone: Use register_sys_off_handler(SYS_OFF_MODE_RESTART) Andrew Davis
@ 2026-03-02 23:07 ` Sebastian Reichel
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2026-03-02 23:07 UTC (permalink / raw)
  To: Santosh Shilimkar, Sebastian Reichel, Andrew Davis; +Cc: linux-kernel, linux-pm


On Mon, 02 Mar 2026 13:33:35 -0600, Andrew Davis wrote:
> Function register_restart_handler() is deprecated. Using this new API
> removes our need to keep and manage a struct notifier_block.
> 
> 

Applied, thanks!

[1/1] power: reset: keystone: Use register_sys_off_handler(SYS_OFF_MODE_RESTART)
      commit: a06517630175468abcce250cdaafec81c4e05ade

Best regards,
-- 
Sebastian Reichel <sebastian.reichel@collabora.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-03-02 23:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-02 19:33 [PATCH] power: reset: keystone: Use register_sys_off_handler(SYS_OFF_MODE_RESTART) Andrew Davis
2026-03-02 23:07 ` Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox