Re: [PATCH] PM / devfreq: rockchip-dfi: convert to devm_platform_ioremap_resource

From: Chanwoo Choi
Date: Sun Dec 15 2019 - 10:32:26 EST


2019ë 12ì 15ì (ì) ìí 10:53, Yangtao Li <tiny.windzz@xxxxxxxxx>ëì ìì:
>
> Use devm_platform_ioremap_resource() to simplify code.
>
> Signed-off-by: Yangtao Li <tiny.windzz@xxxxxxxxx>
> ---
> drivers/devfreq/event/rockchip-dfi.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/devfreq/event/rockchip-dfi.c b/drivers/devfreq/event/rockchip-dfi.c
> index 5d1042188727..cc5d4c01af0b 100644
> --- a/drivers/devfreq/event/rockchip-dfi.c
> +++ b/drivers/devfreq/event/rockchip-dfi.c
> @@ -177,7 +177,6 @@ static int rockchip_dfi_probe(struct platform_device *pdev)
> {
> struct device *dev = &pdev->dev;
> struct rockchip_dfi *data;
> - struct resource *res;
> struct devfreq_event_desc *desc;
> struct device_node *np = pdev->dev.of_node, *node;
>
> @@ -185,8 +184,7 @@ static int rockchip_dfi_probe(struct platform_device *pdev)
> if (!data)
> return -ENOMEM;
>
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - data->regs = devm_ioremap_resource(&pdev->dev, res);
> + data->regs = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(data->regs))
> return PTR_ERR(data->regs);
>
> --
> 2.17.1
>

Applied it.

--
Best Regards,
Chanwoo Choi