[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240212162831.67838-14-afd@ti.com>
Date: Mon, 12 Feb 2024 10:28:25 -0600
From: Andrew Davis <afd@...com>
To: Sebastian Reichel <sre@...nel.org>,
Manivannan Sadhasivam
<manivannan.sadhasivam@...aro.org>,
Cristian Ciocaltea
<cristian.ciocaltea@...il.com>,
Florian Fainelli
<florian.fainelli@...adcom.com>,
Ray Jui <rjui@...adcom.com>, Scott Branden
<sbranden@...adcom.com>,
Bjorn Andersson <andersson@...nel.org>,
Konrad
Dybcio <konrad.dybcio@...aro.org>,
Sean Wang <sean.wang@...iatek.com>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>
CC: <linux-pm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-actions@...ts.infradead.org>, <linux-arm-msm@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>, Andrew Davis <afd@...com>
Subject: [PATCH v4 13/19] power: reset: msm-poweroff: Use devm_register_sys_off_handler(RESTART)
Use device life-cycle managed register function to simplify probe.
Signed-off-by: Andrew Davis <afd@...com>
---
drivers/power/reset/msm-poweroff.c | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/drivers/power/reset/msm-poweroff.c b/drivers/power/reset/msm-poweroff.c
index 3bf0ea06c4853..c7eb6dc8e90ae 100644
--- a/drivers/power/reset/msm-poweroff.c
+++ b/drivers/power/reset/msm-poweroff.c
@@ -14,23 +14,11 @@
#include <linux/pm.h>
static void __iomem *msm_ps_hold;
-static int deassert_pshold(struct notifier_block *nb, unsigned long action,
- void *data)
-{
- writel(0, msm_ps_hold);
- mdelay(10000);
-
- return NOTIFY_DONE;
-}
-
-static struct notifier_block restart_nb = {
- .notifier_call = deassert_pshold,
- .priority = 128,
-};
static int do_msm_poweroff(struct sys_off_data *data)
{
- deassert_pshold(&restart_nb, 0, NULL);
+ writel(0, msm_ps_hold);
+ mdelay(10000);
return NOTIFY_DONE;
}
@@ -41,7 +29,8 @@ static int msm_restart_probe(struct platform_device *pdev)
if (IS_ERR(msm_ps_hold))
return PTR_ERR(msm_ps_hold);
- register_restart_handler(&restart_nb);
+ devm_register_sys_off_handler(&pdev->dev, SYS_OFF_MODE_RESTART,
+ 128, do_msm_poweroff, NULL);
devm_register_sys_off_handler(&pdev->dev, SYS_OFF_MODE_POWER_OFF,
SYS_OFF_PRIO_DEFAULT, do_msm_poweroff,
--
2.39.2
Powered by blists - more mailing lists