diff options
author | Andrew Davis <afd@ti.com> | 2024-02-12 19:28:24 +0300 |
---|---|---|
committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2024-02-13 04:17:26 +0300 |
commit | b5711ff9171325261a7d6406b3c2b3c7752b6b8a (patch) | |
tree | f723606a8e10371e04ea5345e566312b0f62a8ce /drivers/power | |
parent | 6ab9137719a719f39e000aa62887ae25e1194815 (diff) | |
download | linux-b5711ff9171325261a7d6406b3c2b3c7752b6b8a.tar.xz |
power: reset: msm-poweroff: Use devm_register_sys_off_handler(POWER_OFF)
Use this helper to register sys_off handler. Drivers should move away from
setting pm_power_off directly as it only allows for one handler. The new
way allows for trying multiple if the first one doesn't work.
Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240212162831.67838-13-afd@ti.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/reset/msm-poweroff.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/power/reset/msm-poweroff.c b/drivers/power/reset/msm-poweroff.c index d96d248a6e25..3bf0ea06c485 100644 --- a/drivers/power/reset/msm-poweroff.c +++ b/drivers/power/reset/msm-poweroff.c @@ -28,9 +28,11 @@ static struct notifier_block restart_nb = { .priority = 128, }; -static void do_msm_poweroff(void) +static int do_msm_poweroff(struct sys_off_data *data) { deassert_pshold(&restart_nb, 0, NULL); + + return NOTIFY_DONE; } static int msm_restart_probe(struct platform_device *pdev) @@ -41,7 +43,9 @@ static int msm_restart_probe(struct platform_device *pdev) register_restart_handler(&restart_nb); - pm_power_off = do_msm_poweroff; + devm_register_sys_off_handler(&pdev->dev, SYS_OFF_MODE_POWER_OFF, + SYS_OFF_PRIO_DEFAULT, do_msm_poweroff, + NULL); return 0; } |