pinctrl: ti: Convert to devm_platform_get_and_ioremap_resource()
authorYangtao Li <frank.li@vivo.com>
Tue, 4 Jul 2023 12:47:42 +0000 (20:47 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Sun, 16 Jul 2023 21:08:22 +0000 (23:08 +0200)
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230704124742.9596-4-frank.li@vivo.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/ti/pinctrl-ti-iodelay.c

index 53abddaebce1bfc21a79c7779980264072b62c1b..c1477f65783933f29161a4bf57d5f8986d0be9f3 100644 (file)
@@ -849,19 +849,12 @@ static int ti_iodelay_probe(struct platform_device *pdev)
        iod->reg_data = match->data;
 
        /* So far We can assume there is only 1 bank of registers */
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!res) {
-               dev_err(dev, "Missing MEM resource\n");
-               ret = -ENODEV;
-               goto exit_out;
-       }
-
-       iod->phys_base = res->start;
-       iod->reg_base = devm_ioremap_resource(dev, res);
+       iod->reg_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
        if (IS_ERR(iod->reg_base)) {
                ret = PTR_ERR(iod->reg_base);
                goto exit_out;
        }
+       iod->phys_base = res->start;
 
        iod->regmap = devm_regmap_init_mmio(dev, iod->reg_base,
                                            iod->reg_data->regmap_config);