summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorYangtao Li <frank.li@vivo.com>2023-07-13 12:44:22 +0200
committerMiquel Raynal <miquel.raynal@bootlin.com>2023-07-15 18:05:32 +0200
commitb798f7729ca66a620242435f0d325aefe0a13b31 (patch)
tree82e4d88715ebe625cd43371a27d04251f4f2404b /drivers/mtd
parentmtd: nand: samsung: Convert to devm_platform_ioremap_resource() and devm_plat... (diff)
downloadlinux-b798f7729ca66a620242435f0d325aefe0a13b31.tar.xz
linux-b798f7729ca66a620242435f0d325aefe0a13b31.zip
mtd: nand: omap: Use devm_platform_get_and_ioremap_resource()
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> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20230713104422.29222-1-frank.li@vivo.com
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/onenand/onenand_omap2.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/mtd/nand/onenand/onenand_omap2.c b/drivers/mtd/nand/onenand/onenand_omap2.c
index ff7af98604df..904df2d1538e 100644
--- a/drivers/mtd/nand/onenand/onenand_omap2.c
+++ b/drivers/mtd/nand/onenand/onenand_omap2.c
@@ -467,12 +467,6 @@ static int omap2_onenand_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct device_node *np = dev->of_node;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res) {
- dev_err(dev, "error getting memory resource\n");
- return -EINVAL;
- }
-
r = of_property_read_u32(np, "reg", &val);
if (r) {
dev_err(dev, "reg not found in DT\n");
@@ -486,11 +480,11 @@ static int omap2_onenand_probe(struct platform_device *pdev)
init_completion(&c->irq_done);
init_completion(&c->dma_done);
c->gpmc_cs = val;
- c->phys_base = res->start;
- c->onenand.base = devm_ioremap_resource(dev, res);
+ c->onenand.base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(c->onenand.base))
return PTR_ERR(c->onenand.base);
+ c->phys_base = res->start;
c->int_gpiod = devm_gpiod_get_optional(dev, "int", GPIOD_IN);
if (IS_ERR(c->int_gpiod)) {