mtd: rawnand: sunxi: Use devm_platform_get_and_ioremap_resource()
authorYangtao Li <frank.li@vivo.com>
Fri, 7 Jul 2023 04:06:05 +0000 (12:06 +0800)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 12 Jul 2023 12:07:42 +0000 (14:07 +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>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20230707040622.78174-1-frank.li@vivo.com
drivers/mtd/nand/raw/sunxi_nand.c

index 9884304634f68a4a242cec3a81114f58c9d98ebf..db36bd755b8d923700f0c710a7854264044f9ea2 100644 (file)
@@ -2087,8 +2087,7 @@ static int sunxi_nfc_probe(struct platform_device *pdev)
        nand_controller_init(&nfc->controller);
        INIT_LIST_HEAD(&nfc->chips);
 
-       r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       nfc->regs = devm_ioremap_resource(dev, r);
+       nfc->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &r);
        if (IS_ERR(nfc->regs))
                return PTR_ERR(nfc->regs);