pwm: vt8500: Convert to devm_platform_ioremap_resource()
authorYangtao Li <tiny.windzz@gmail.com>
Sun, 29 Dec 2019 08:06:02 +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: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-vt8500.c

index 11d45e56a923f34313b01745b5b86cade7d26222..6e36851a22bb09dd7cdbdf685241b8c6ce543b73 100644 (file)
@@ -193,7 +193,6 @@ MODULE_DEVICE_TABLE(of, vt8500_pwm_dt_ids);
 static int vt8500_pwm_probe(struct platform_device *pdev)
 {
        struct vt8500_chip *chip;
-       struct resource *r;
        struct device_node *np = pdev->dev.of_node;
        int ret;
 
@@ -219,8 +218,7 @@ static int vt8500_pwm_probe(struct platform_device *pdev)
                return PTR_ERR(chip->clk);
        }
 
-       r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       chip->base = devm_ioremap_resource(&pdev->dev, r);
+       chip->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(chip->base))
                return PTR_ERR(chip->base);