ata: pata_ftide010: Use devm_platform_get_and_ioremap_resource()
authorYangtao Li <frank.li@vivo.com>
Mon, 10 Jul 2023 02:45:49 +0000 (10:45 +0800)
committerDamien Le Moal <dlemoal@kernel.org>
Wed, 2 Aug 2023 08:37:06 +0000 (17:37 +0900)
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>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
drivers/ata/pata_ftide010.c

index 9409fbd48c5a1b79fb91c55decdb968b81b4344a..ae455f3de18e12de61ee128b25a5086842ba635b 100644 (file)
@@ -469,11 +469,7 @@ static int pata_ftide010_probe(struct platform_device *pdev)
        if (irq < 0)
                return irq;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!res)
-               return -ENODEV;
-
-       ftide->base = devm_ioremap_resource(dev, res);
+       ftide->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
        if (IS_ERR(ftide->base))
                return PTR_ERR(ftide->base);