]> git.baikalelectronics.ru Git - kernel.git/commitdiff
pwm: sun4i: Convert to devm_platform_ioremap_resource()
authorYangtao Li <tiny.windzz@gmail.com>
Sun, 29 Dec 2019 08:05:39 +0000 (08:05 +0000)
committerThierry Reding <thierry.reding@gmail.com>
Thu, 17 Dec 2020 13:18:37 +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-sun4i.c

index 38a4c5c1317b24bf40ae20c32460492f2b024bce..cc1eb0818648eb5c251dd013e43580e16cc8127b 100644 (file)
@@ -395,7 +395,6 @@ MODULE_DEVICE_TABLE(of, sun4i_pwm_dt_ids);
 static int sun4i_pwm_probe(struct platform_device *pdev)
 {
        struct sun4i_pwm_chip *pwm;
-       struct resource *res;
        int ret;
 
        pwm = devm_kzalloc(&pdev->dev, sizeof(*pwm), GFP_KERNEL);
@@ -406,8 +405,7 @@ static int sun4i_pwm_probe(struct platform_device *pdev)
        if (!pwm->data)
                return -ENODEV;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       pwm->base = devm_ioremap_resource(&pdev->dev, res);
+       pwm->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(pwm->base))
                return PTR_ERR(pwm->base);