mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
power: reset: keystone: 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> Link: https://patch.msgid.link/20260303175959.75647-1-afd@ti.com Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
committed by
Sebastian Reichel
parent
e6d91eed84
commit
c2bfe2edf7
@@ -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 = devm_register_sys_off_handler(dev, SYS_OFF_MODE_RESTART, 128,
|
||||
rsctrl_restart_handler, NULL);
|
||||
if (ret)
|
||||
dev_err(dev, "cannot register restart handler (err=%d)\n", ret);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user