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>
This commit is contained in:
parent
ad8d7b8002
commit
0867276eb1
1 changed files with 4 additions and 9 deletions
|
@ -41,28 +41,23 @@ static int rmobile_reset_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
sysc_base2 = of_iomap(pdev->dev.of_node, 1);
|
sysc_base2 = devm_platform_ioremap_resource(pdev, 0);
|
||||||
if (!sysc_base2)
|
if (IS_ERR(sysc_base2))
|
||||||
return -ENODEV;
|
return PTR_ERR(sysc_base2);
|
||||||
|
|
||||||
error = register_restart_handler(&rmobile_reset_nb);
|
error = register_restart_handler(&rmobile_reset_nb);
|
||||||
if (error) {
|
if (error) {
|
||||||
dev_err(&pdev->dev,
|
dev_err(&pdev->dev,
|
||||||
"cannot register restart handler (err=%d)\n", error);
|
"cannot register restart handler (err=%d)\n", error);
|
||||||
goto fail_unmap;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail_unmap:
|
|
||||||
iounmap(sysc_base2);
|
|
||||||
return error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rmobile_reset_remove(struct platform_device *pdev)
|
static void rmobile_reset_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
unregister_restart_handler(&rmobile_reset_nb);
|
unregister_restart_handler(&rmobile_reset_nb);
|
||||||
iounmap(sysc_base2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct of_device_id rmobile_reset_of_match[] = {
|
static const struct of_device_id rmobile_reset_of_match[] = {
|
||||||
|
|
Loading…
Add table
Reference in a new issue