diff mbox series

[v3,3/4] dmaengine: rcar-dmac: Use devm_platform_ioremap_resource()

Message ID 1568010892-17606-4-git-send-email-yoshihiro.shimoda.uh@renesas.com (mailing list archive)
State Accepted
Headers show
Series dmaengine: rcar-dmac: use of_data and add dma-channel-mask support | expand

Commit Message

Yoshihiro Shimoda Sept. 9, 2019, 6:34 a.m. UTC
This patch uses devm_platform_ioremap_resource() instead of
using platform_get_resource() and devm_ioremap_resource() together
to simplify.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/dma/sh/rcar-dmac.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Simon Horman Sept. 13, 2019, 8:46 a.m. UTC | #1
On Mon, Sep 09, 2019 at 03:34:51PM +0900, Yoshihiro Shimoda wrote:
> This patch uses devm_platform_ioremap_resource() instead of
> using platform_get_resource() and devm_ioremap_resource() together
> to simplify.
> 
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

> ---
>  drivers/dma/sh/rcar-dmac.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
> index 74996a0..542786d 100644
> --- a/drivers/dma/sh/rcar-dmac.c
> +++ b/drivers/dma/sh/rcar-dmac.c
> @@ -1824,7 +1824,6 @@ static int rcar_dmac_probe(struct platform_device *pdev)
>  	struct dma_device *engine;
>  	struct rcar_dmac *dmac;
>  	const struct rcar_dmac_of_data *data;
> -	struct resource *mem;
>  	unsigned int i;
>  	int ret;
>  
> @@ -1863,8 +1862,7 @@ static int rcar_dmac_probe(struct platform_device *pdev)
>  		return -ENOMEM;
>  
>  	/* Request resources. */
> -	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	dmac->iomem = devm_ioremap_resource(&pdev->dev, mem);
> +	dmac->iomem = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(dmac->iomem))
>  		return PTR_ERR(dmac->iomem);
>  
> -- 
> 2.7.4
>
diff mbox series

Patch

diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index 74996a0..542786d 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -1824,7 +1824,6 @@  static int rcar_dmac_probe(struct platform_device *pdev)
 	struct dma_device *engine;
 	struct rcar_dmac *dmac;
 	const struct rcar_dmac_of_data *data;
-	struct resource *mem;
 	unsigned int i;
 	int ret;
 
@@ -1863,8 +1862,7 @@  static int rcar_dmac_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	/* Request resources. */
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	dmac->iomem = devm_ioremap_resource(&pdev->dev, mem);
+	dmac->iomem = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(dmac->iomem))
 		return PTR_ERR(dmac->iomem);