Commit ea5bc54b authored by Boris Brezillon's avatar Boris Brezillon

mtd: maps: physmap: Use devm_ioremap_resource()

Use devm_ioremap_resource() to replace the devm_request_mem_region() +
devm_ioremap() combination.
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: default avatarRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 16f2101b
......@@ -129,17 +129,15 @@ static int physmap_flash_probe(struct platform_device *dev)
if (!res)
break;
dev_notice(&dev->dev, "physmap platform flash device: %pR\n",
res);
if (!devm_request_mem_region(&dev->dev, res->start,
resource_size(res),
dev_name(&dev->dev))) {
dev_err(&dev->dev, "Could not reserve memory region\n");
err = -ENOMEM;
info->maps[i].virt = devm_ioremap_resource(&dev->dev, res);
if (IS_ERR(info->maps[i].virt)) {
err = PTR_ERR(info->maps[i].virt);
goto err_out;
}
dev_notice(&dev->dev, "physmap platform flash device: %pR\n",
res);
info->maps[i].name = dev_name(&dev->dev);
info->maps[i].phys = res->start;
info->maps[i].size = resource_size(res);
......@@ -148,15 +146,6 @@ static int physmap_flash_probe(struct platform_device *dev)
info->maps[i].pfow_base = physmap_data->pfow_base;
info->maps[i].map_priv_1 = (unsigned long)dev;
info->maps[i].virt = devm_ioremap(&dev->dev,
info->maps[i].phys,
info->maps[i].size);
if (info->maps[i].virt == NULL) {
dev_err(&dev->dev, "Failed to ioremap flash region\n");
err = -EIO;
goto err_out;
}
simple_map_init(&info->maps[i]);
probe_type = rom_probe_types;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment