From: <ye.xingchen@zte.com.cn>
To: <miquel.raynal@bootlin.com>
Cc: <richard@nod.at>, <vigneshr@ti.com>,
<linux-mtd@lists.infradead.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] mtd: rawnand: fsmc: use devm_platform_ioremap_resource_byname()
Date: Tue, 21 Mar 2023 19:54:04 +0800 (CST) [thread overview]
Message-ID: <202303211954042531445@zte.com.cn> (raw)
From: Ye Xingchen <ye.xingchen@zte.com.cn>
Convert platform_get_resource_byname(),devm_ioremap_resource() to a single
call to devm_platform_ioremap_resource_byname(), as this is exactly what
this function does.
Signed-off-by: Ye Xingchen <ye.xingchen@zte.com.cn>
---
drivers/mtd/nand/raw/fsmc_nand.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/mtd/nand/raw/fsmc_nand.c b/drivers/mtd/nand/raw/fsmc_nand.c
index 6b2bda815b88..cb2eb6a79043 100644
--- a/drivers/mtd/nand/raw/fsmc_nand.c
+++ b/drivers/mtd/nand/raw/fsmc_nand.c
@@ -1041,25 +1041,21 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
if (ret)
return ret;
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand_data");
- host->data_va = devm_ioremap_resource(&pdev->dev, res);
+ host->data_va = devm_platform_ioremap_resource_byname(pdev, "nand_data");
if (IS_ERR(host->data_va))
return PTR_ERR(host->data_va);
host->data_pa = (dma_addr_t)res->start;
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand_addr");
- host->addr_va = devm_ioremap_resource(&pdev->dev, res);
+ host->addr_va = devm_platform_ioremap_resource_byname(pdev, "nand_addr");
if (IS_ERR(host->addr_va))
return PTR_ERR(host->addr_va);
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand_cmd");
- host->cmd_va = devm_ioremap_resource(&pdev->dev, res);
+ host->cmd_va = devm_platform_ioremap_resource_byname(pdev, "nand_cmd");
if (IS_ERR(host->cmd_va))
return PTR_ERR(host->cmd_va);
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fsmc_regs");
- base = devm_ioremap_resource(&pdev->dev, res);
+ base = devm_platform_ioremap_resource_byname(pdev, "fsmc_regs");
if (IS_ERR(base))
return PTR_ERR(base);
--
2.25.1
next reply other threads:[~2023-03-21 11:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-21 11:54 ye.xingchen [this message]
2023-03-21 18:34 ` [PATCH] mtd: rawnand: fsmc: use devm_platform_ioremap_resource_byname() kernel test robot
2023-03-22 15:27 ` Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202303211954042531445@zte.com.cn \
--to=ye.xingchen@zte.com.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox