Skip to contentSkip to conversation

dmaengine: jz4780: Use devm_platform_ioremap_resource() in jz4780_dma_probe()

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

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

PATCH 1/1 dmaengine: jz4780: Use devm_platform_ioremap_resource() in jz4780_dma_probe()

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

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

This issue was detected by using the Coccinelle software.

---
 drivers/dma/dma-jz4780.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/dma/dma-jz4780.c +1 -7
index cafb1cc065bb..f42b3ef8e036 100644
@@ -858,13 +858,7 @@ static int jz4780_dma_probe(struct platform_device *pdev)
 	jzdma->soc_data = soc_data;
 	platform_set_drvdata(pdev, jzdma);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(dev, "failed to get I/O memory\n");
-		return -EINVAL;
-	}
-
-	jzdma->chn_base = devm_ioremap_resource(dev, res);
+	jzdma->chn_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(jzdma->chn_base))
 		return PTR_ERR(jzdma->chn_base);
 

--
2.23.0

maintainer
#1 lore raw

Hi Markus,

Quoted 9 lines · Markus Elfring

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

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

This issue was detected by using the Coccinelle software.

Looks good to me.

Quoted 27 lines
---
 drivers/dma/dma-jz4780.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/dma/dma-jz4780.c +1 -8
index cafb1cc065bb..f42b3ef8e036 100644
@@ -858,13 +858,7 @@ static int jz4780_dma_probe(struct 
 platform_device *pdev)
 	jzdma->soc_data = soc_data;
 	platform_set_drvdata(pdev, jzdma);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(dev, "failed to get I/O memory\n");
-		return -EINVAL;
-	}
-
-	jzdma->chn_base = devm_ioremap_resource(dev, res);
+	jzdma->chn_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(jzdma->chn_base))
 		return PTR_ERR(jzdma->chn_base);
 
--

2.23.0

maintainer
#2 lore raw
Quoted 11 lines · Paul Cercueil

Hi Markus,

Le dim. 22 sept. 2019 à 11:25, Markus Elfring <[email protected]> a écrit :

Quoted 6 lines

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

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

Quoted 7 lines
Quoted 3 lines

This issue was detected by using the Coccinelle software.

Looks good to me.

Did you mean Acked or Reviewed ...??

Signature · 1 line
~Vinod
maintainer Reviewed-by
#3 lore raw

Hi Vinod,

Le lun., oct. 14, 2019 at 12:44, Vinod Koul <[email protected]> a écrit :

Quoted 15 lines · Paul Cercueil
Quoted 14 lines

Hi Markus,

Le dim. 22 sept. 2019 à 11:25, Markus Elfring
<[email protected]> a
écrit :

Quoted 8 lines

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

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

This issue was detected by using the Coccinelle software.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Looks good to me.

Did you mean Acked or Reviewed ...??

Definitely. Sorry about that.

Quoted 3 lines

--
~Vinod

maintainer Applied
#4 lore raw
In reply to Markus Elfring
Quoted 7 lines · Markus Elfring

From: Markus Elfring <[email protected]>
Date: Sun, 22 Sep 2019 11:18:27 +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