linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 08/11] i2c: sh_mobile: Use devm_platform_get_and_ioremap_resource()
       [not found] <20230710063351.17490-1-frank.li@vivo.com>
@ 2023-07-10  6:33 ` Yangtao Li
  2023-07-10 12:13   ` Geert Uytterhoeven
  2023-07-12 15:57   ` Andi Shyti
  0 siblings, 2 replies; 3+ messages in thread
From: Yangtao Li @ 2023-07-10  6:33 UTC (permalink / raw)
  To: Wolfram Sang, Andi Shyti
  Cc: Yangtao Li, linux-renesas-soc, linux-i2c, linux-kernel

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>
---
v2:
-s/devm_platform_get_and_ioremap_resource(pdev/devm_platform_get_and_ioremap_resource(dev
 drivers/i2c/busses/i2c-sh_mobile.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c
index 21717b943a9e..163fc118873f 100644
--- a/drivers/i2c/busses/i2c-sh_mobile.c
+++ b/drivers/i2c/busses/i2c-sh_mobile.c
@@ -871,7 +871,6 @@ static int sh_mobile_i2c_probe(struct platform_device *dev)
 {
 	struct sh_mobile_i2c_data *pd;
 	struct i2c_adapter *adap;
-	struct resource *res;
 	const struct sh_mobile_dt_config *config;
 	int ret;
 	u32 bus_speed;
@@ -893,10 +892,7 @@ static int sh_mobile_i2c_probe(struct platform_device *dev)
 	pd->dev = &dev->dev;
 	platform_set_drvdata(dev, pd);
 
-	res = platform_get_resource(dev, IORESOURCE_MEM, 0);
-
-	pd->res = res;
-	pd->reg = devm_ioremap_resource(&dev->dev, res);
+	pd->reg = devm_platform_get_and_ioremap_resource(dev, 0, &pd->res);
 	if (IS_ERR(pd->reg))
 		return PTR_ERR(pd->reg);
 
@@ -905,7 +901,7 @@ static int sh_mobile_i2c_probe(struct platform_device *dev)
 	pd->clks_per_count = 1;
 
 	/* Newer variants come with two new bits in ICIC */
-	if (resource_size(res) > 0x17)
+	if (resource_size(pd->res) > 0x17)
 		pd->flags |= IIC_FLAG_HAS_ICIC67;
 
 	pm_runtime_enable(&dev->dev);
-- 
2.39.0


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

* Re: [PATCH v2 08/11] i2c: sh_mobile: Use devm_platform_get_and_ioremap_resource()
  2023-07-10  6:33 ` [PATCH v2 08/11] i2c: sh_mobile: Use devm_platform_get_and_ioremap_resource() Yangtao Li
@ 2023-07-10 12:13   ` Geert Uytterhoeven
  2023-07-12 15:57   ` Andi Shyti
  1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2023-07-10 12:13 UTC (permalink / raw)
  To: Yangtao Li
  Cc: Wolfram Sang, Andi Shyti, linux-renesas-soc, linux-i2c, linux-kernel

On Mon, Jul 10, 2023 at 8:41 AM Yangtao Li <frank.li@vivo.com> 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>
> ---
> v2:
> -s/devm_platform_get_and_ioremap_resource(pdev/devm_platform_get_and_ioremap_resource(dev

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v2 08/11] i2c: sh_mobile: Use devm_platform_get_and_ioremap_resource()
  2023-07-10  6:33 ` [PATCH v2 08/11] i2c: sh_mobile: Use devm_platform_get_and_ioremap_resource() Yangtao Li
  2023-07-10 12:13   ` Geert Uytterhoeven
@ 2023-07-12 15:57   ` Andi Shyti
  1 sibling, 0 replies; 3+ messages in thread
From: Andi Shyti @ 2023-07-12 15:57 UTC (permalink / raw)
  To: Yangtao Li; +Cc: Wolfram Sang, linux-renesas-soc, linux-i2c, linux-kernel

Hi Yangtao,

On Mon, Jul 10, 2023 at 02:33:47PM +0800, 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>

Reviewed-by: Andi Shyti <andi.shyti@kernel.org> 

Andi

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

end of thread, other threads:[~2023-07-12 15:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20230710063351.17490-1-frank.li@vivo.com>
2023-07-10  6:33 ` [PATCH v2 08/11] i2c: sh_mobile: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-10 12:13   ` Geert Uytterhoeven
2023-07-12 15:57   ` Andi Shyti

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