diff options
author | Claudiu Beznea <claudiu.beznea@microchip.com> | 2021-04-02 12:50:18 +0200 |
---|---|---|
committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2021-04-02 13:11:45 +0200 |
commit | bd3127733f2c1c666bbe105c5317d8ce98e088ee (patch) | |
tree | 024afebd6d908ab96d0b09a6d2d619b978b3d097 /drivers/power | |
parent | dt-bindings: power: update battery.yaml reference (diff) | |
download | linux-bd3127733f2c1c666bbe105c5317d8ce98e088ee.tar.xz linux-bd3127733f2c1c666bbe105c5317d8ce98e088ee.zip |
power: reset: at91-reset: use devm_of_iomap
Use devm_of_iomap() to map resources. This will avoid the necessity to
track the mapped resources and free them on failure path or on remove.
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Suggested-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/reset/at91-reset.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/power/reset/at91-reset.c b/drivers/power/reset/at91-reset.c index 3ff9d93a5226..026649409135 100644 --- a/drivers/power/reset/at91-reset.c +++ b/drivers/power/reset/at91-reset.c @@ -192,7 +192,7 @@ static int __init at91_reset_probe(struct platform_device *pdev) if (!reset) return -ENOMEM; - reset->rstc_base = of_iomap(pdev->dev.of_node, 0); + reset->rstc_base = devm_of_iomap(&pdev->dev, pdev->dev.of_node, 0, NULL); if (!reset->rstc_base) { dev_err(&pdev->dev, "Could not map reset controller address\n"); return -ENODEV; @@ -202,7 +202,7 @@ static int __init at91_reset_probe(struct platform_device *pdev) /* we need to shutdown the ddr controller, so get ramc base */ for_each_matching_node_and_match(np, at91_ramc_of_match, &match) { reset->ramc_lpr = (u32)match->data; - reset->ramc_base[idx] = of_iomap(np, 0); + reset->ramc_base[idx] = devm_of_iomap(&pdev->dev, np, 0, NULL); if (!reset->ramc_base[idx]) { dev_err(&pdev->dev, "Could not map ram controller address\n"); of_node_put(np); |