dmaengine: sprd: Use devm_ioremap_resource() to map memory

Instead of checking the return value of platform_get_resource(), we can
use devm_ioremap_resource() which has the NULL pointer check and the
memory region requesting.

Suggested-by: Lars-Peter Clausen <[email protected]>
Signed-off-by: Baolin Wang <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
This commit is contained in:
Baolin Wang 2018-05-09 11:23:50 +08:00 • committed by Vinod Koul
commit e7f063ae1a

View file

@ -807,10 +807,7 @@ static int sprd_dma_probe(struct platform_device *pdev)
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -EINVAL;
sdev->glb_base = devm_ioremap_nocache(&pdev->dev, res->start,
resource_size(res));
sdev->glb_base = devm_ioremap_resource(&pdev->dev, res);
if (!sdev->glb_base)
return -ENOMEM;