Commit 9d68427d authored by Markus Elfring's avatar Markus Elfring Committed by Vinod Koul

dmaengine: mediatek: Use devm_platform_ioremap_resource() in mtk_cqdma_probe()

Simplify this function implementation a bit by using
a known wrapper function.

This issue was detected by using the Coccinelle software.
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Link: https://lore.kernel.org/r/c7e3bbae-44fa-9019-18ee-c6cdfd7c2a14@web.deSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 3d4d6c27
...@@ -819,15 +819,7 @@ static int mtk_cqdma_probe(struct platform_device *pdev) ...@@ -819,15 +819,7 @@ static int mtk_cqdma_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&cqdma->pc[i]->queue); INIT_LIST_HEAD(&cqdma->pc[i]->queue);
spin_lock_init(&cqdma->pc[i]->lock); spin_lock_init(&cqdma->pc[i]->lock);
refcount_set(&cqdma->pc[i]->refcnt, 0); refcount_set(&cqdma->pc[i]->refcnt, 0);
cqdma->pc[i]->base = devm_platform_ioremap_resource(pdev, i);
res = platform_get_resource(pdev, IORESOURCE_MEM, i);
if (!res) {
dev_err(&pdev->dev, "No mem resource for %s\n",
dev_name(&pdev->dev));
return -EINVAL;
}
cqdma->pc[i]->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(cqdma->pc[i]->base)) if (IS_ERR(cqdma->pc[i]->base))
return PTR_ERR(cqdma->pc[i]->base); return PTR_ERR(cqdma->pc[i]->base);
......
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