linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dma: Make use of the helper function devm_platform_ioremap_resource()
@ 2022-04-21  8:45 cgel.zte
  2022-04-22  6:04 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-04-21  8:45 UTC (permalink / raw)
  To: vkoul, shawnguo, s.hauer
  Cc: kernel, festevam, linux-imx, dmaengine, linux-arm-kernel,
	linux-kernel, Lv Ruyi, Zeal Robot

From: Lv Ruyi <lv.ruyi@zte.com.cn>

Use the devm_platform_ioremap_resource() helper instead of calling
platform_get_resource() and devm_ioremap_resource() separately.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
 drivers/dma/imx-sdma.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 6196a7b3956b..cf4667d10f6a 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -2073,7 +2073,6 @@ static int sdma_probe(struct platform_device *pdev)
 	const char *fw_name;
 	int ret;
 	int irq;
-	struct resource *iores;
 	struct resource spba_res;
 	int i;
 	struct sdma_engine *sdma;
@@ -2096,8 +2095,7 @@ static int sdma_probe(struct platform_device *pdev)
 	if (irq < 0)
 		return irq;
 
-	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	sdma->regs = devm_ioremap_resource(&pdev->dev, iores);
+	sdma->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(sdma->regs))
 		return PTR_ERR(sdma->regs);
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] dma: Make use of the helper function devm_platform_ioremap_resource()
  2022-04-21  8:45 [PATCH] dma: Make use of the helper function devm_platform_ioremap_resource() cgel.zte
@ 2022-04-22  6:04 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2022-04-22  6:04 UTC (permalink / raw)
  To: cgel.zte
  Cc: shawnguo, s.hauer, kernel, festevam, linux-imx, dmaengine,
	linux-arm-kernel, linux-kernel, Lv Ruyi, Zeal Robot

On 21-04-22, 08:45, cgel.zte@gmail.com wrote:
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
> 

It is dmaengine: not dma:

Also add driver tag to subject line. git log would help you choosing
right tags

> Use the devm_platform_ioremap_resource() helper instead of calling
> platform_get_resource() and devm_ioremap_resource() separately.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>

Where is the report?

> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
> ---
>  drivers/dma/imx-sdma.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
> index 6196a7b3956b..cf4667d10f6a 100644
> --- a/drivers/dma/imx-sdma.c
> +++ b/drivers/dma/imx-sdma.c
> @@ -2073,7 +2073,6 @@ static int sdma_probe(struct platform_device *pdev)
>  	const char *fw_name;
>  	int ret;
>  	int irq;
> -	struct resource *iores;
>  	struct resource spba_res;
>  	int i;
>  	struct sdma_engine *sdma;
> @@ -2096,8 +2095,7 @@ static int sdma_probe(struct platform_device *pdev)
>  	if (irq < 0)
>  		return irq;
>  
> -	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	sdma->regs = devm_ioremap_resource(&pdev->dev, iores);
> +	sdma->regs = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(sdma->regs))
>  		return PTR_ERR(sdma->regs);
>  
> -- 
> 2.25.1

-- 
~Vinod

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-22  6:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-21  8:45 [PATCH] dma: Make use of the helper function devm_platform_ioremap_resource() cgel.zte
2022-04-22  6:04 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).