[1/7] bus: sunxi-rsb: Convert to devm_platform_ioremap_resource()

Message ID 20230706072042.31296-1-frank.li@vivo.com
State New
Headers
Series [1/7] bus: sunxi-rsb: Convert to devm_platform_ioremap_resource() |

Commit Message

李扬韬 July 6, 2023, 7:20 a.m. UTC
  Use devm_platform_ioremap_resource() to simplify code.

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

Comments

Jernej Škrabec July 11, 2023, 6:25 p.m. UTC | #1
Dne četrtek, 06. julij 2023 ob 09:20:36 CEST je Yangtao Li napisal(a):
> Use devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>

Best regards,
Jernej

> ---
>  drivers/bus/sunxi-rsb.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/bus/sunxi-rsb.c b/drivers/bus/sunxi-rsb.c
> index 696c0aefb0ca..2aefd5dde3c9 100644
> --- a/drivers/bus/sunxi-rsb.c
> +++ b/drivers/bus/sunxi-rsb.c
> @@ -746,7 +746,6 @@ static int sunxi_rsb_probe(struct platform_device *pdev)
> {
>  	struct device *dev = &pdev->dev;
>  	struct device_node *np = dev->of_node;
> -	struct resource *r;
>  	struct sunxi_rsb *rsb;
>  	u32 clk_freq = 3000000;
>  	int irq, ret;
> @@ -766,8 +765,7 @@ static int sunxi_rsb_probe(struct platform_device *pdev)
> rsb->dev = dev;
>  	rsb->clk_freq = clk_freq;
>  	platform_set_drvdata(pdev, rsb);
> -	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	rsb->regs = devm_ioremap_resource(dev, r);
> +	rsb->regs = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(rsb->regs))
>  		return PTR_ERR(rsb->regs);
  
Thierry Reding July 21, 2023, 3:28 p.m. UTC | #2
From: Thierry Reding <treding@nvidia.com>


On Thu, 06 Jul 2023 15:20:36 +0800, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
> 
> 

Applied, thanks!

[5/7] bus: tegra-gmi: Convert to devm_platform_ioremap_resource()
      commit: df823d210395341c58e8d346dfc37d6e67e9f2c6

Best regards,
  
Jernej Škrabec July 30, 2023, 10:50 p.m. UTC | #3
Dne četrtek, 06. julij 2023 ob 09:20:36 CEST je Yangtao Li napisal(a):
> Use devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Applied, thanks!

Best regards,
Jernej
  

Patch

diff --git a/drivers/bus/sunxi-rsb.c b/drivers/bus/sunxi-rsb.c
index 696c0aefb0ca..2aefd5dde3c9 100644
--- a/drivers/bus/sunxi-rsb.c
+++ b/drivers/bus/sunxi-rsb.c
@@ -746,7 +746,6 @@  static int sunxi_rsb_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct device_node *np = dev->of_node;
-	struct resource *r;
 	struct sunxi_rsb *rsb;
 	u32 clk_freq = 3000000;
 	int irq, ret;
@@ -766,8 +765,7 @@  static int sunxi_rsb_probe(struct platform_device *pdev)
 	rsb->dev = dev;
 	rsb->clk_freq = clk_freq;
 	platform_set_drvdata(pdev, rsb);
-	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	rsb->regs = devm_ioremap_resource(dev, r);
+	rsb->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(rsb->regs))
 		return PTR_ERR(rsb->regs);