summaryrefslogtreecommitdiffstats
path: root/drivers/power/reset
diff options
context:
space:
mode:
authorAndrew Davis <afd@ti.com>2024-02-12 17:28:21 +0100
committerSebastian Reichel <sebastian.reichel@collabora.com>2024-02-13 02:17:25 +0100
commit0867276eb12230a5e94ec2b28eba718e76b77eb1 (patch)
treeda564b0b19226b2a9222bdd7ac49809ec50109b4 /drivers/power/reset
parentpower: reset: axxia-reset: Use devm_register_sys_off_handler(RESTART) (diff)
downloadlinux-0867276eb12230a5e94ec2b28eba718e76b77eb1.tar.xz
linux-0867276eb12230a5e94ec2b28eba718e76b77eb1.zip
power: reset: rmobile-reset: Use devm_platform_ioremap_resource() helper
Use device life-cycle managed ioremap function to simplify probe and exit paths. Signed-off-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20240212162831.67838-10-afd@ti.com Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power/reset')
-rw-r--r--drivers/power/reset/rmobile-reset.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/power/reset/rmobile-reset.c b/drivers/power/reset/rmobile-reset.c
index 5df9b41c68c7..29c17ed2d4de 100644
--- a/drivers/power/reset/rmobile-reset.c
+++ b/drivers/power/reset/rmobile-reset.c
@@ -41,28 +41,23 @@ static int rmobile_reset_probe(struct platform_device *pdev)
{
int error;
- sysc_base2 = of_iomap(pdev->dev.of_node, 1);
- if (!sysc_base2)
- return -ENODEV;
+ sysc_base2 = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(sysc_base2))
+ return PTR_ERR(sysc_base2);
error = register_restart_handler(&rmobile_reset_nb);
if (error) {
dev_err(&pdev->dev,
"cannot register restart handler (err=%d)\n", error);
- goto fail_unmap;
+ return error;
}
return 0;
-
-fail_unmap:
- iounmap(sysc_base2);
- return error;
}
static void rmobile_reset_remove(struct platform_device *pdev)
{
unregister_restart_handler(&rmobile_reset_nb);
- iounmap(sysc_base2);
}
static const struct of_device_id rmobile_reset_of_match[] = {