提交 e7f063ae 编写于 作者: B Baolin Wang 提交者: Vinod Koul

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: NLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: NBaolin Wang <baolin.wang@linaro.org>
Signed-off-by: NVinod Koul <vkoul@kernel.org>
上级 e891e41e
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册