Skip to contentSkip to conversation

dmaengine: k3dma: Use devm_platform_ioremap_resource() in k3_dma_probe()

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

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

PATCH 1/1 dmaengine: k3dma: Use devm_platform_ioremap_resource() in k3_dma_probe()

From: Markus Elfring <[email protected]>
Date: Sun, 22 Sep 2019 11:36:18 +0200

Simplify this function implementation by using a known wrapper function.

This issue was detected by using the Coccinelle software.

---
 drivers/dma/k3dma.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/dma/k3dma.c +1 -6
index 4b36c8810517..adecea51814f 100644
@@ -835,13 +835,8 @@ static int k3_dma_probe(struct platform_device *op)
 	const struct k3dma_soc_data *soc_data;
 	struct k3_dma_dev *d;
 	const struct of_device_id *of_id;
-	struct resource *iores;
 	int i, ret, irq = 0;
 
-	iores = platform_get_resource(op, IORESOURCE_MEM, 0);
-	if (!iores)
-		return -EINVAL;
-
 	d = devm_kzalloc(&op->dev, sizeof(*d), GFP_KERNEL);
 	if (!d)
 		return -ENOMEM;
@@ -850,7 +845,7 @@ static int k3_dma_probe(struct platform_device *op)
 	if (!soc_data)
 		return -EINVAL;
 
-	d->base = devm_ioremap_resource(&op->dev, iores);
+	d->base = devm_platform_ioremap_resource(op, 0);
 	if (IS_ERR(d->base))
 		return PTR_ERR(d->base);
 

--
2.23.0

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

From: Markus Elfring <[email protected]>
Date: Sun, 22 Sep 2019 11:36:18 +0200

Simplify this function implementation by using a known wrapper function.

This issue was detected by using the Coccinelle software.

Applied, thanks

Signature · 1 line
~Vinod