lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240201180102.70395-7-afd@ti.com>
Date: Thu, 1 Feb 2024 12:00:50 -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 06/18] power: reset: brcm-kona-reset: 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/brcm-kona-reset.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/power/reset/brcm-kona-reset.c b/drivers/power/reset/brcm-kona-reset.c
index d05728b1db097..4bb956c8f24f8 100644
--- a/drivers/power/reset/brcm-kona-reset.c
+++ b/drivers/power/reset/brcm-kona-reset.c
@@ -13,11 +13,10 @@
 #define RSTMGR_WR_PASSWORD_SHIFT	8
 #define RSTMGR_WR_ACCESS_ENABLE		1
 
-static void __iomem *kona_reset_base;
-
-static int kona_reset_handler(struct notifier_block *this,
-				unsigned long mode, void *cmd)
+static int kona_reset_handler(struct sys_off_data *data)
 {
+	void __iomem *kona_reset_base = data->cb_data;
+
 	/*
 	 * A soft reset is triggered by writing a 0 to bit 0 of the soft reset
 	 * register. To write to that register we must first write the password
@@ -31,18 +30,17 @@ static int kona_reset_handler(struct notifier_block *this,
 	return NOTIFY_DONE;
 }
 
-static struct notifier_block kona_reset_nb = {
-	.notifier_call = kona_reset_handler,
-	.priority = 128,
-};
-
 static int kona_reset_probe(struct platform_device *pdev)
 {
+	void __iomem *kona_reset_base;
+
 	kona_reset_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(kona_reset_base))
 		return PTR_ERR(kona_reset_base);
 
-	return register_restart_handler(&kona_reset_nb);
+	return devm_register_sys_off_handler(&pdev->dev, SYS_OFF_MODE_RESTART,
+					     128, kona_reset_handler,
+					     kona_reset_base);
 }
 
 static const struct of_device_id of_match[] = {
-- 
2.39.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ