Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Claudiu Beznea and committed by
Sebastian Reichel
bd312773 e4e40929

+2 -2
+2 -2
drivers/power/reset/at91-reset.c
··· 192 192 if (!reset) 193 193 return -ENOMEM; 194 194 195 - reset->rstc_base = of_iomap(pdev->dev.of_node, 0); 195 + reset->rstc_base = devm_of_iomap(&pdev->dev, pdev->dev.of_node, 0, NULL); 196 196 if (!reset->rstc_base) { 197 197 dev_err(&pdev->dev, "Could not map reset controller address\n"); 198 198 return -ENODEV; ··· 202 202 /* we need to shutdown the ddr controller, so get ramc base */ 203 203 for_each_matching_node_and_match(np, at91_ramc_of_match, &match) { 204 204 reset->ramc_lpr = (u32)match->data; 205 - reset->ramc_base[idx] = of_iomap(np, 0); 205 + reset->ramc_base[idx] = devm_of_iomap(&pdev->dev, np, 0, NULL); 206 206 if (!reset->ramc_base[idx]) { 207 207 dev_err(&pdev->dev, "Could not map ram controller address\n"); 208 208 of_node_put(np);