dma: ti: dma-crossbar: convert to devm_platform_ioremap_resource()
diff mbox series

Message ID 1580189746-2864-1-git-send-email-qiwuchen55@gmail.com
State In Next
Commit acd624185d204b0ae2360b4648cc50802df5da01
Headers show
Series
  • dma: ti: dma-crossbar: convert to devm_platform_ioremap_resource()
Related show

Commit Message

chenqiwu Jan. 28, 2020, 5:35 a.m. UTC
From: chenqiwu <chenqiwu@xiaomi.com>

Use a new API devm_platform_ioremap_resource() to simplify code.

Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
---
 drivers/dma/ti/dma-crossbar.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Comments

Peter Ujfalusi Jan. 28, 2020, 7:53 a.m. UTC | #1
On 28/01/2020 7.35, qiwuchen55@gmail.com wrote:
> From: chenqiwu <chenqiwu@xiaomi.com>
> 
> Use a new API devm_platform_ioremap_resource() to simplify code.

Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

> Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
> ---
>  drivers/dma/ti/dma-crossbar.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/dma/ti/dma-crossbar.c b/drivers/dma/ti/dma-crossbar.c
> index f255056..4ba8fa5 100644
> --- a/drivers/dma/ti/dma-crossbar.c
> +++ b/drivers/dma/ti/dma-crossbar.c
> @@ -133,7 +133,6 @@ static int ti_am335x_xbar_probe(struct platform_device *pdev)
>  	const struct of_device_id *match;
>  	struct device_node *dma_node;
>  	struct ti_am335x_xbar_data *xbar;
> -	struct resource *res;
>  	void __iomem *iomem;
>  	int i, ret;
>  
> @@ -173,8 +172,7 @@ static int ti_am335x_xbar_probe(struct platform_device *pdev)
>  		xbar->xbar_events = TI_AM335X_XBAR_LINES;
>  	}
>  
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	iomem = devm_ioremap_resource(&pdev->dev, res);
> +	iomem = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(iomem))
>  		return PTR_ERR(iomem);
>  
> @@ -323,7 +321,6 @@ static int ti_dra7_xbar_probe(struct platform_device *pdev)
>  	struct device_node *dma_node;
>  	struct ti_dra7_xbar_data *xbar;
>  	struct property *prop;
> -	struct resource *res;
>  	u32 safe_val;
>  	int sz;
>  	void __iomem *iomem;
> @@ -403,8 +400,7 @@ static int ti_dra7_xbar_probe(struct platform_device *pdev)
>  		kfree(rsv_events);
>  	}
>  
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	iomem = devm_ioremap_resource(&pdev->dev, res);
> +	iomem = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(iomem))
>  		return PTR_ERR(iomem);
>  
> 

- P├ęter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Vinod Koul Feb. 13, 2020, 3:19 p.m. UTC | #2
On 28-01-20, 13:35, qiwuchen55@gmail.com wrote:
> From: chenqiwu <chenqiwu@xiaomi.com>
> 
> Use a new API devm_platform_ioremap_resource() to simplify code.

Subsystem name is 'dmaengine' pls use that tag instead.
Applied after fixing the tag, thanks

Patch
diff mbox series

diff --git a/drivers/dma/ti/dma-crossbar.c b/drivers/dma/ti/dma-crossbar.c
index f255056..4ba8fa5 100644
--- a/drivers/dma/ti/dma-crossbar.c
+++ b/drivers/dma/ti/dma-crossbar.c
@@ -133,7 +133,6 @@  static int ti_am335x_xbar_probe(struct platform_device *pdev)
 	const struct of_device_id *match;
 	struct device_node *dma_node;
 	struct ti_am335x_xbar_data *xbar;
-	struct resource *res;
 	void __iomem *iomem;
 	int i, ret;
 
@@ -173,8 +172,7 @@  static int ti_am335x_xbar_probe(struct platform_device *pdev)
 		xbar->xbar_events = TI_AM335X_XBAR_LINES;
 	}
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	iomem = devm_ioremap_resource(&pdev->dev, res);
+	iomem = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(iomem))
 		return PTR_ERR(iomem);
 
@@ -323,7 +321,6 @@  static int ti_dra7_xbar_probe(struct platform_device *pdev)
 	struct device_node *dma_node;
 	struct ti_dra7_xbar_data *xbar;
 	struct property *prop;
-	struct resource *res;
 	u32 safe_val;
 	int sz;
 	void __iomem *iomem;
@@ -403,8 +400,7 @@  static int ti_dra7_xbar_probe(struct platform_device *pdev)
 		kfree(rsv_events);
 	}
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	iomem = devm_ioremap_resource(&pdev->dev, res);
+	iomem = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(iomem))
 		return PTR_ERR(iomem);