summaryrefslogtreecommitdiff
path: root/drivers/power/reset
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2024-02-26 13:54:52 +0300
committerSebastian Reichel <sebastian.reichel@collabora.com>2024-02-26 17:09:11 +0300
commit3da8d71754d3c1aa0b72d74c8a324a4bc7fab473 (patch)
treed95040d97d6a03e6d4c998a0a65964f10a873e06 /drivers/power/reset
parent7b46b60944d77e361a727cd8ce46aec31c146e26 (diff)
downloadlinux-3da8d71754d3c1aa0b72d74c8a324a4bc7fab473.tar.xz
power: reset: rmobile-reset: Make sysc_base2 local
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@glider.be> Link: https://lore.kernel.org/r/35f04935c48ae55dc562071e0a1d6fca65234a58.1708944642.git.geert+renesas@glider.be Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power/reset')
-rw-r--r--drivers/power/reset/rmobile-reset.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/power/reset/rmobile-reset.c b/drivers/power/reset/rmobile-reset.c
index 14682cd59e61..7dbc51c32b0e 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);