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

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-meson.c

index bd0d7336b8983beefc9c3cebe0e601dd6955ed31..a3ce9789412ae3fff322581b22b7f64ebb6f76ce 100644 (file)
@@ -537,15 +537,13 @@ static int meson_pwm_init_channels(struct meson_pwm *meson)
 static int meson_pwm_probe(struct platform_device *pdev)
 {
        struct meson_pwm *meson;
-       struct resource *regs;
        int err;
 
        meson = devm_kzalloc(&pdev->dev, sizeof(*meson), GFP_KERNEL);
        if (!meson)
                return -ENOMEM;
 
-       regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       meson->base = devm_ioremap_resource(&pdev->dev, regs);
+       meson->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(meson->base))
                return PTR_ERR(meson->base);