power: reset: ocelot: Convert to devm_platform_ioremap_resource()
authorYangtao Li <frank.li@vivo.com>
Tue, 4 Jul 2023 13:03:08 +0000 (21:03 +0800)
committerSebastian Reichel <sre@kernel.org>
Wed, 19 Jul 2023 21:31:49 +0000 (23:31 +0200)
Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/reset/ocelot-reset.c

index 44c7730..56be64d 100644 (file)
@@ -69,8 +69,6 @@ static int ocelot_restart_handle(struct notifier_block *this,
 static int ocelot_reset_probe(struct platform_device *pdev)
 {
        struct ocelot_reset_context *ctx;
-       struct resource *res;
-
        struct device *dev = &pdev->dev;
        int err;
 
@@ -78,8 +76,7 @@ static int ocelot_reset_probe(struct platform_device *pdev)
        if (!ctx)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       ctx->base = devm_ioremap_resource(dev, res);
+       ctx->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(ctx->base))
                return PTR_ERR(ctx->base);