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

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Acked-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-atmel.c

index 6161e7e..5813339 100644 (file)
@@ -401,7 +401,6 @@ MODULE_DEVICE_TABLE(of, atmel_pwm_dt_ids);
 static int atmel_pwm_probe(struct platform_device *pdev)
 {
        struct atmel_pwm_chip *atmel_pwm;
-       struct resource *res;
        int ret;
 
        atmel_pwm = devm_kzalloc(&pdev->dev, sizeof(*atmel_pwm), GFP_KERNEL);
@@ -412,8 +411,7 @@ static int atmel_pwm_probe(struct platform_device *pdev)
        atmel_pwm->data = of_device_get_match_data(&pdev->dev);
        atmel_pwm->updated_pwms = 0;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       atmel_pwm->base = devm_ioremap_resource(&pdev->dev, res);
+       atmel_pwm->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(atmel_pwm->base))
                return PTR_ERR(atmel_pwm->base);