Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: rawnand: intel: Use devm_platform_ioremap_resource_byname()

Switch from open-coded platform_get_resource_byname() and
devm_ioremap_resource() to devm_platform_ioremap_resource_byname() where
possible to simplify the code.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220702231227.1579176-9-martin.blumenstingl@googlemail.com

authored by

Martin Blumenstingl and committed by
Miquel Raynal
7471a53d 1b9bdc21

+4 -6
+4 -6
drivers/mtd/nand/raw/intel-nand-controller.c
··· 592 592 ebu_host->dev = dev; 593 593 nand_controller_init(&ebu_host->controller); 594 594 595 - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ebunand"); 596 - ebu_host->ebu = devm_ioremap_resource(&pdev->dev, res); 595 + ebu_host->ebu = devm_platform_ioremap_resource_byname(pdev, "ebunand"); 597 596 if (IS_ERR(ebu_host->ebu)) 598 597 return PTR_ERR(ebu_host->ebu); 599 598 600 - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hsnand"); 601 - ebu_host->hsnand = devm_ioremap_resource(&pdev->dev, res); 599 + ebu_host->hsnand = devm_platform_ioremap_resource_byname(pdev, "hsnand"); 602 600 if (IS_ERR(ebu_host->hsnand)) 603 601 return PTR_ERR(ebu_host->hsnand); 604 602 ··· 618 620 ebu_host->cs_num = cs; 619 621 620 622 resname = devm_kasprintf(dev, GFP_KERNEL, "nand_cs%d", cs); 621 - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, resname); 622 - ebu_host->cs[cs].chipaddr = devm_ioremap_resource(dev, res); 623 + ebu_host->cs[cs].chipaddr = devm_platform_ioremap_resource_byname(pdev, 624 + resname); 623 625 if (IS_ERR(ebu_host->cs[cs].chipaddr)) 624 626 return PTR_ERR(ebu_host->cs[cs].chipaddr); 625 627