Re: [PATCH 12/17] clk: socfpga: convert to devm_platform_ioremap_resource

From: Dinh Nguyen
Date: Mon Dec 16 2019 - 15:20:59 EST




On 12/9/19 1:57 PM, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
>
> Signed-off-by: Yangtao Li <tiny.windzz@xxxxxxxxx>
> ---
> drivers/clk/socfpga/clk-s10.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/clk/socfpga/clk-s10.c b/drivers/clk/socfpga/clk-s10.c
> index 993f3a73c71e..85055fc56404 100644
> --- a/drivers/clk/socfpga/clk-s10.c
> +++ b/drivers/clk/socfpga/clk-s10.c
> @@ -276,11 +276,9 @@ static struct stratix10_clock_data *__socfpga_s10_clk_init(struct platform_devic
> struct device *dev = &pdev->dev;
> struct stratix10_clock_data *clk_data;
> struct clk **clk_table;
> - struct resource *res;
> void __iomem *base;
>
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - base = devm_ioremap_resource(dev, res);
> + base = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(base)) {
> pr_err("%s: failed to map clock registers\n", __func__);
> return ERR_CAST(base);
>

Tested-by: Dinh Nguyen <dinguyen@xxxxxxxxxx>