[PATCH] power: reset: rmobile-reset: Make sysc_base2 local

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The static global variable sysc_base2 is no longer used outside the
probe method and the reset handler, so it can be converted to a local
variable, and passed to the reset handler via its callback data.

Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
---
Depends on commits 0867276eb12230a5 ("power: reset: rmobile-reset: Use
devm_platform_ioremap_resource() helper") and ba1188ea8be80a7b ("power:
reset: rmobile-reset: Use devm_register_sys_off_handler(RESTART)") in
battery/for-next (next-20240214 and later).
---
 drivers/power/reset/rmobile-reset.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/power/reset/rmobile-reset.c b/drivers/power/reset/rmobile-reset.c
index 14682cd59e618d5f..7dbc51c32b0eb4b0 100644
--- a/drivers/power/reset/rmobile-reset.c
+++ b/drivers/power/reset/rmobile-reset.c
@@ -19,10 +19,10 @@
 /* Reset Control Register 2 */
 #define RESCNT2_PRES	0x80000000	/* Soft power-on reset */
 
-static void __iomem *sysc_base2;
-
 static int rmobile_reset_handler(struct sys_off_data *data)
 {
+	void __iomem *sysc_base2 = (void __iomem *)data->cb_data;
+
 	/* Let's assume we have acquired the HPB semaphore */
 	writel(RESCNT2_PRES, sysc_base2 + RESCNT2);
 
@@ -31,6 +31,7 @@ static int rmobile_reset_handler(struct sys_off_data *data)
 
 static int rmobile_reset_probe(struct platform_device *pdev)
 {
+	void __iomem *sysc_base2;
 	int error;
 
 	sysc_base2 = devm_platform_ioremap_resource(pdev, 1);
@@ -41,7 +42,7 @@ static int rmobile_reset_probe(struct platform_device *pdev)
 					      SYS_OFF_MODE_RESTART,
 					      SYS_OFF_PRIO_HIGH,
 					      rmobile_reset_handler,
-					      NULL);
+					      (__force void *)sysc_base2);
 	if (error) {
 		dev_err(&pdev->dev,
 			"cannot register restart handler (err=%d)\n", error);
-- 
2.34.1





[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux