linux-fpga.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fpga-manager: use devm_platform_get_and_ioremap_resource()
@ 2022-11-11  6:41 ye.xingchen
  2022-11-14  8:34 ` Xu Yilun
  0 siblings, 1 reply; 2+ messages in thread
From: ye.xingchen @ 2022-11-11  6:41 UTC (permalink / raw)
  To: mdf; +Cc: hao.wu, yilun.xu, trix, linux-fpga, linux-kernel, chi.minghao

From: Minghao Chi <chi.minghao@zte.com.cn>

Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
---
 drivers/fpga/socfpga-a10.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/fpga/socfpga-a10.c b/drivers/fpga/socfpga-a10.c
index ac8e89b8a5cc..dde2cb49e95d 100644
--- a/drivers/fpga/socfpga-a10.c
+++ b/drivers/fpga/socfpga-a10.c
@@ -479,8 +479,7 @@ static int socfpga_a10_fpga_probe(struct platform_device *pdev)
 		return -ENOMEM;

 	/* First mmio base is for register access */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	reg_base = devm_ioremap_resource(dev, res);
+	reg_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 	if (IS_ERR(reg_base))
 		return PTR_ERR(reg_base);

-- 
2.25.1

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

* Re: [PATCH] fpga-manager: use devm_platform_get_and_ioremap_resource()
  2022-11-11  6:41 [PATCH] fpga-manager: use devm_platform_get_and_ioremap_resource() ye.xingchen
@ 2022-11-14  8:34 ` Xu Yilun
  0 siblings, 0 replies; 2+ messages in thread
From: Xu Yilun @ 2022-11-14  8:34 UTC (permalink / raw)
  To: ye.xingchen; +Cc: mdf, hao.wu, trix, linux-fpga, linux-kernel, chi.minghao

On 2022-11-11 at 14:41:16 +0800, ye.xingchen@zte.com.cn wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
> 
> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to devm_platform_get_and_ioremap_resource(), as this is exactly
> what this function does.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>

Please add your own SoB.

> ---
>  drivers/fpga/socfpga-a10.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/fpga/socfpga-a10.c b/drivers/fpga/socfpga-a10.c
> index ac8e89b8a5cc..dde2cb49e95d 100644
> --- a/drivers/fpga/socfpga-a10.c
> +++ b/drivers/fpga/socfpga-a10.c
> @@ -479,8 +479,7 @@ static int socfpga_a10_fpga_probe(struct platform_device *pdev)
>  		return -ENOMEM;
> 
>  	/* First mmio base is for register access */
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	reg_base = devm_ioremap_resource(dev, res);
> +	reg_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);

Why keep the variable res?

>  	if (IS_ERR(reg_base))
>  		return PTR_ERR(reg_base);

And please make all related changes, at least in driver/fpga.

Thanks,
Yilun

> 
> -- 
> 2.25.1

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

end of thread, other threads:[~2022-11-14  8:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-11  6:41 [PATCH] fpga-manager: use devm_platform_get_and_ioremap_resource() ye.xingchen
2022-11-14  8:34 ` Xu Yilun

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).