Skip to contentSkip to conversation

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

PATCH Applied Markus Elfring 2 participants 2 messages Sep 22, 2019 – Oct 14, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmaengine: mediatek: Use devm_platform_ioremap_resource() in mtk_cqdma_probe()

From: Markus Elfring <[email protected]>
Date: Sun, 22 Sep 2019 12:52:25 +0200

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

This issue was detected by using the Coccinelle software.

---
 drivers/dma/mediatek/mtk-cqdma.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/dma/mediatek/mtk-cqdma.c +1 -9
index 723b11c190b3..6bf838e63be1 100644
@@ -819,15 +819,7 @@ static int mtk_cqdma_probe(struct platform_device *pdev)
 		INIT_LIST_HEAD(&cqdma->pc[i]->queue);
 		spin_lock_init(&cqdma->pc[i]->lock);
 		refcount_set(&cqdma->pc[i]->refcnt, 0);
-
-		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);
+		cqdma->pc[i]->base = devm_platform_ioremap_resource(pdev, i);
 		if (IS_ERR(cqdma->pc[i]->base))
 			return PTR_ERR(cqdma->pc[i]->base);
 

--
2.23.0

maintainer Applied
#1 lore raw
Quoted 7 lines · Markus Elfring

From: Markus Elfring <[email protected]>
Date: Sun, 22 Sep 2019 12:52:25 +0200

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

This issue was detected by using the Coccinelle software.

Applied, thanks

Signature · 1 line
~Vinod