Commit 5aec892a authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

ASoC: omap-mcbsp: Convert to use devm_ioremap_resource

Use devm_ioremap_resource() instead of open code.
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Acked-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent bc0195aa
...@@ -965,25 +965,15 @@ int omap_mcbsp_init(struct platform_device *pdev) ...@@ -965,25 +965,15 @@ int omap_mcbsp_init(struct platform_device *pdev)
mcbsp->free = true; mcbsp->free = true;
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu"); res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu");
if (!res) { if (!res)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(mcbsp->dev, "invalid memory resource\n"); mcbsp->io_base = devm_ioremap_resource(&pdev->dev, res);
return -ENOMEM; if (IS_ERR(mcbsp->io_base))
} return PTR_ERR(mcbsp->io_base);
}
if (!devm_request_mem_region(&pdev->dev, res->start, resource_size(res),
dev_name(&pdev->dev))) {
dev_err(mcbsp->dev, "memory region already claimed\n");
return -ENODEV;
}
mcbsp->phys_base = res->start; mcbsp->phys_base = res->start;
mcbsp->reg_cache_size = resource_size(res); mcbsp->reg_cache_size = resource_size(res);
mcbsp->io_base = devm_ioremap(&pdev->dev, res->start,
resource_size(res));
if (!mcbsp->io_base)
return -ENOMEM;
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dma"); res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dma");
if (!res) if (!res)
......
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