Commit c96b3e09 authored by Yangtao Li's avatar Yangtao Li Committed by Miquel Raynal

mtd: rawnand: mxc: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.
Signed-off-by: default avatarYangtao Li <frank.li@vivo.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20230707040622.78174-3-frank.li@vivo.com
parent 1c66c752
...@@ -1696,7 +1696,6 @@ static int mxcnd_probe(struct platform_device *pdev) ...@@ -1696,7 +1696,6 @@ static int mxcnd_probe(struct platform_device *pdev)
struct nand_chip *this; struct nand_chip *this;
struct mtd_info *mtd; struct mtd_info *mtd;
struct mxc_nand_host *host; struct mxc_nand_host *host;
struct resource *res;
int err = 0; int err = 0;
/* Allocate memory for MTD device structure and private data */ /* Allocate memory for MTD device structure and private data */
...@@ -1740,17 +1739,15 @@ static int mxcnd_probe(struct platform_device *pdev) ...@@ -1740,17 +1739,15 @@ static int mxcnd_probe(struct platform_device *pdev)
this->options |= NAND_KEEP_TIMINGS; this->options |= NAND_KEEP_TIMINGS;
if (host->devtype_data->needs_ip) { if (host->devtype_data->needs_ip) {
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); host->regs_ip = devm_platform_ioremap_resource(pdev, 0);
host->regs_ip = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(host->regs_ip)) if (IS_ERR(host->regs_ip))
return PTR_ERR(host->regs_ip); return PTR_ERR(host->regs_ip);
res = platform_get_resource(pdev, IORESOURCE_MEM, 1); host->base = devm_platform_ioremap_resource(pdev, 1);
} else { } else {
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); host->base = devm_platform_ioremap_resource(pdev, 0);
} }
host->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(host->base)) if (IS_ERR(host->base))
return PTR_ERR(host->base); return PTR_ERR(host->base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment