pwm: mtk-disp: Convert to devm_platform_ioremap_resource()
authorYangtao Li <tiny.windzz@gmail.com>
Sun, 29 Dec 2019 08:06:04 +0000 (08:06 +0000)
committerThierry Reding <thierry.reding@gmail.com>
Thu, 17 Dec 2020 13:18:44 +0000 (14:18 +0100)
Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-mtk-disp.c

index 83b8be0209b74f2801cca403c3cbb61ca6776e43..87c6b4bc5d439a4d09dcc0f0c318cb397ba9c8d0 100644 (file)
@@ -172,7 +172,6 @@ static const struct pwm_ops mtk_disp_pwm_ops = {
 static int mtk_disp_pwm_probe(struct platform_device *pdev)
 {
        struct mtk_disp_pwm *mdp;
-       struct resource *r;
        int ret;
 
        mdp = devm_kzalloc(&pdev->dev, sizeof(*mdp), GFP_KERNEL);
@@ -181,8 +180,7 @@ static int mtk_disp_pwm_probe(struct platform_device *pdev)
 
        mdp->data = of_device_get_match_data(&pdev->dev);
 
-       r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       mdp->base = devm_ioremap_resource(&pdev->dev, r);
+       mdp->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(mdp->base))
                return PTR_ERR(mdp->base);