* [PATCH 01/13] clk: sunxi: sun9i-mmc: Use devm_platform_get_and_ioremap_resource()
@ 2023-07-05 6:53 Yangtao Li
2023-07-11 18:27 ` Jernej Škrabec
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Yangtao Li @ 2023-07-05 6:53 UTC (permalink / raw)
To: Emilio López, Michael Turquette, Stephen Boyd, Chen-Yu Tsai,
Jernej Skrabec, Samuel Holland
Cc: Yangtao Li, linux-clk, linux-arm-kernel, linux-sunxi,
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/clk/sunxi/clk-sun9i-mmc.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/clk/sunxi/clk-sun9i-mmc.c b/drivers/clk/sunxi/clk-sun9i-mmc.c
index 636bcf2439ef..0862b02b1ed4 100644
--- a/drivers/clk/sunxi/clk-sun9i-mmc.c
+++ b/drivers/clk/sunxi/clk-sun9i-mmc.c
@@ -108,15 +108,13 @@ static int sun9i_a80_mmc_config_clk_probe(struct platform_device *pdev)
spin_lock_init(&data->lock);
- r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!r)
- return -EINVAL;
- /* one clock/reset pair per word */
- count = DIV_ROUND_UP((resource_size(r)), SUN9I_MMC_WIDTH);
- data->membase = devm_ioremap_resource(&pdev->dev, r);
+ data->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &r);
if (IS_ERR(data->membase))
return PTR_ERR(data->membase);
+ /* one clock/reset pair per word */
+ count = DIV_ROUND_UP((resource_size(r)), SUN9I_MMC_WIDTH);
+
clk_data = &data->clk_data;
clk_data->clk_num = count;
clk_data->clks = devm_kcalloc(&pdev->dev, count, sizeof(struct clk *),
--
2.39.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 01/13] clk: sunxi: sun9i-mmc: Use devm_platform_get_and_ioremap_resource()
2023-07-05 6:53 [PATCH 01/13] clk: sunxi: sun9i-mmc: Use devm_platform_get_and_ioremap_resource() Yangtao Li
@ 2023-07-11 18:27 ` Jernej Škrabec
2023-07-30 22:44 ` Jernej Škrabec
2023-08-14 10:09 ` Abel Vesa
2 siblings, 0 replies; 4+ messages in thread
From: Jernej Škrabec @ 2023-07-11 18:27 UTC (permalink / raw)
To: Emilio López, Michael Turquette, Stephen Boyd, Chen-Yu Tsai,
Samuel Holland, Yangtao Li
Cc: Yangtao Li, linux-clk, linux-arm-kernel, linux-sunxi,
linux-kernel
Dne sreda, 05. julij 2023 ob 08:53:01 CEST je Yangtao Li napisal(a):
> 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>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
> ---
> drivers/clk/sunxi/clk-sun9i-mmc.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/clk/sunxi/clk-sun9i-mmc.c
> b/drivers/clk/sunxi/clk-sun9i-mmc.c index 636bcf2439ef..0862b02b1ed4 100644
> --- a/drivers/clk/sunxi/clk-sun9i-mmc.c
> +++ b/drivers/clk/sunxi/clk-sun9i-mmc.c
> @@ -108,15 +108,13 @@ static int sun9i_a80_mmc_config_clk_probe(struct
> platform_device *pdev)
>
> spin_lock_init(&data->lock);
>
> - r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - if (!r)
> - return -EINVAL;
> - /* one clock/reset pair per word */
> - count = DIV_ROUND_UP((resource_size(r)), SUN9I_MMC_WIDTH);
> - data->membase = devm_ioremap_resource(&pdev->dev, r);
> + data->membase = devm_platform_get_and_ioremap_resource(pdev, 0,
&r);
> if (IS_ERR(data->membase))
> return PTR_ERR(data->membase);
>
> + /* one clock/reset pair per word */
> + count = DIV_ROUND_UP((resource_size(r)), SUN9I_MMC_WIDTH);
> +
> clk_data = &data->clk_data;
> clk_data->clk_num = count;
> clk_data->clks = devm_kcalloc(&pdev->dev, count, sizeof(struct clk
*),
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 01/13] clk: sunxi: sun9i-mmc: Use devm_platform_get_and_ioremap_resource()
2023-07-05 6:53 [PATCH 01/13] clk: sunxi: sun9i-mmc: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-11 18:27 ` Jernej Škrabec
@ 2023-07-30 22:44 ` Jernej Škrabec
2023-08-14 10:09 ` Abel Vesa
2 siblings, 0 replies; 4+ messages in thread
From: Jernej Škrabec @ 2023-07-30 22:44 UTC (permalink / raw)
To: Emilio López, Michael Turquette, Stephen Boyd, Chen-Yu Tsai,
Samuel Holland, Yangtao Li
Cc: Yangtao Li, linux-clk, linux-arm-kernel, linux-sunxi,
linux-kernel
Dne sreda, 05. julij 2023 ob 08:53:01 CEST je Yangtao Li napisal(a):
> 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>
Applied, thanks!
Best regards,
Jernej
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 01/13] clk: sunxi: sun9i-mmc: Use devm_platform_get_and_ioremap_resource()
2023-07-05 6:53 [PATCH 01/13] clk: sunxi: sun9i-mmc: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-11 18:27 ` Jernej Škrabec
2023-07-30 22:44 ` Jernej Škrabec
@ 2023-08-14 10:09 ` Abel Vesa
2 siblings, 0 replies; 4+ messages in thread
From: Abel Vesa @ 2023-08-14 10:09 UTC (permalink / raw)
To: Emilio López, Michael Turquette, Stephen Boyd, Chen-Yu Tsai,
Jernej Skrabec, Samuel Holland, Yangtao Li
Cc: linux-clk, linux-arm-kernel, linux-sunxi, linux-kernel
On Wed, 05 Jul 2023 14:53:01 +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.
>
>
Applied, thanks!
[08/13] clk: imx: clk-imx8qxp-lpcg: Convert to devm_platform_ioremap_resource()
commit: 94945b23133db0b698ffe764d8a82593906d1e74
Best regards,
--
Abel Vesa <abel.vesa@linaro.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-08-14 10:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-05 6:53 [PATCH 01/13] clk: sunxi: sun9i-mmc: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-11 18:27 ` Jernej Škrabec
2023-07-30 22:44 ` Jernej Škrabec
2023-08-14 10:09 ` Abel Vesa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox