[3/3] misc: xilinx_tmr_manager: Use devm_platform_get_and_ioremap_resource()

Message ID 20230707024224.78907-3-frank.li@vivo.com
State New
Headers
Series [1/3] misc: atmel-ssc: Use devm_platform_get_and_ioremap_resource() |

Commit Message

李扬韬 July 7, 2023, 2:42 a.m. UTC
  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.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/misc/xilinx_tmr_manager.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
  

Comments

Michal Simek July 7, 2023, 6:21 a.m. UTC | #1
On 7/7/23 04:42, Yangtao Li wrote:
> 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.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
>   drivers/misc/xilinx_tmr_manager.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/misc/xilinx_tmr_manager.c b/drivers/misc/xilinx_tmr_manager.c
> index 0ef55e06d3a0..2e7a5f37a01f 100644
> --- a/drivers/misc/xilinx_tmr_manager.c
> +++ b/drivers/misc/xilinx_tmr_manager.c
> @@ -170,8 +170,7 @@ static int xtmr_manager_probe(struct platform_device *pdev)
>   	if (!xtmr_manager)
>   		return -ENOMEM;
>   
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	xtmr_manager->regs =  devm_ioremap_resource(&pdev->dev, res);
> +	xtmr_manager->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
>   	if (IS_ERR(xtmr_manager->regs))
>   		return PTR_ERR(xtmr_manager->regs);
>   

Reviewed-by: Michal Simek <michal.simek@amd.com>

Thanks,
M
  

Patch

diff --git a/drivers/misc/xilinx_tmr_manager.c b/drivers/misc/xilinx_tmr_manager.c
index 0ef55e06d3a0..2e7a5f37a01f 100644
--- a/drivers/misc/xilinx_tmr_manager.c
+++ b/drivers/misc/xilinx_tmr_manager.c
@@ -170,8 +170,7 @@  static int xtmr_manager_probe(struct platform_device *pdev)
 	if (!xtmr_manager)
 		return -ENOMEM;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	xtmr_manager->regs =  devm_ioremap_resource(&pdev->dev, res);
+	xtmr_manager->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 	if (IS_ERR(xtmr_manager->regs))
 		return PTR_ERR(xtmr_manager->regs);