diff --git a/drivers/power/reset/st-poweroff.c b/drivers/power/reset/st-poweroff.c index a0acf25ee2a2c9182843e27cc3adc9e208747f27..27383de9caa87b952a270512bd3d497d1f6a7321 100644 --- a/drivers/power/reset/st-poweroff.c +++ b/drivers/power/reset/st-poweroff.c @@ -15,10 +15,9 @@ #include #include #include +#include #include -#include - struct reset_syscfg { struct regmap *regmap; /* syscfg used for reset */ @@ -75,7 +74,8 @@ static struct reset_syscfg stid127_reset = { static struct reset_syscfg *st_restart_syscfg; -static void st_restart(enum reboot_mode reboot_mode, const char *cmd) +static int st_restart(struct notifier_block *this, unsigned long mode, + void *cmd) { /* reset syscfg updated */ regmap_update_bits(st_restart_syscfg->regmap, @@ -88,8 +88,15 @@ static void st_restart(enum reboot_mode reboot_mode, const char *cmd) st_restart_syscfg->offset_rst_msk, st_restart_syscfg->mask_rst_msk, 0); + + return NOTIFY_DONE; } +static struct notifier_block st_restart_nb = { + .notifier_call = st_restart, + .priority = 192, +}; + static struct of_device_id st_reset_of_match[] = { { .compatible = "st,stih415-restart", @@ -126,9 +133,7 @@ static int st_reset_probe(struct platform_device *pdev) return PTR_ERR(st_restart_syscfg->regmap); } - arm_pm_restart = st_restart; - - return 0; + return register_restart_handler(&st_restart_nb); } static struct platform_driver st_reset_driver = {