* [PATCH 08/11] i2c: sh_mobile: Use devm_platform_get_and_ioremap_resource()
[not found] <20230705135159.33327-1-frank.li@vivo.com>
@ 2023-07-05 13:51 ` Yangtao Li
2023-07-05 14:44 ` Geert Uytterhoeven
0 siblings, 1 reply; 3+ messages in thread
From: Yangtao Li @ 2023-07-05 13:51 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>
---
drivers/i2c/busses/i2c-sh_mobile.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c
index 21717b943a9e..e2da633b5e9d 100644
--- a/drivers/i2c/busses/i2c-sh_mobile.c
+++ b/drivers/i2c/busses/i2c-sh_mobile.c
@@ -893,12 +893,10 @@ 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(pdev, 0, &res);
if (IS_ERR(pd->reg))
return PTR_ERR(pd->reg);
+ pd->res = res;
ret = of_property_read_u32(dev->dev.of_node, "clock-frequency", &bus_speed);
pd->bus_speed = (ret || !bus_speed) ? I2C_MAX_STANDARD_MODE_FREQ : bus_speed;
--
2.39.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 08/11] i2c: sh_mobile: Use devm_platform_get_and_ioremap_resource()
2023-07-05 13:51 ` [PATCH 08/11] i2c: sh_mobile: Use devm_platform_get_and_ioremap_resource() Yangtao Li
@ 2023-07-05 14:44 ` Geert Uytterhoeven
2023-07-06 19:21 ` Wolfram Sang
0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2023-07-05 14:44 UTC (permalink / raw)
To: Yangtao Li
Cc: Wolfram Sang, Andi Shyti, linux-renesas-soc, linux-i2c, linux-kernel
Hi Yangtao,
On Wed, Jul 5, 2023 at 3:56 PM 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>
Thanks for your patch!
> --- a/drivers/i2c/busses/i2c-sh_mobile.c
> +++ b/drivers/i2c/busses/i2c-sh_mobile.c
> @@ -893,12 +893,10 @@ 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(pdev, 0, &res);
"pdev" does not exist in this context.
Please try to at least compile-test your patches before submitting them.
> if (IS_ERR(pd->reg))
> return PTR_ERR(pd->reg);
> + pd->res = res;
While at it, you could get rid of "res", and replace it by "pd->res" in the
above call to devm_platform_get_and_ioremap_resource().
>
> ret = of_property_read_u32(dev->dev.of_node, "clock-frequency", &bus_speed);
> pd->bus_speed = (ret || !bus_speed) ? I2C_MAX_STANDARD_MODE_FREQ : bus_speed;
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 08/11] i2c: sh_mobile: Use devm_platform_get_and_ioremap_resource()
2023-07-05 14:44 ` Geert Uytterhoeven
@ 2023-07-06 19:21 ` Wolfram Sang
0 siblings, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2023-07-06 19:21 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Yangtao Li, Andi Shyti, linux-renesas-soc, linux-i2c, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 178 bytes --]
> Please try to at least compile-test your patches before submitting them.
Yes and no. Not "please try" but "please do". Rejecting this series
until it has been build tested.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-07-06 19:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20230705135159.33327-1-frank.li@vivo.com>
2023-07-05 13:51 ` [PATCH 08/11] i2c: sh_mobile: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-05 14:44 ` Geert Uytterhoeven
2023-07-06 19:21 ` Wolfram Sang
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).