[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230705122644.32236-6-frank.li@vivo.com>
Date: Wed, 5 Jul 2023 20:26:44 +0800
From: Yangtao Li <frank.li@...o.com>
To: Krzysztof Halasa <khalasa@...p.pl>
Cc: Yangtao Li <frank.li@...o.com>, linux-kernel@...r.kernel.org
Subject: [PATCH 6/6] soc: ixp4xx/npe: 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@...o.com>
---
drivers/soc/ixp4xx/ixp4xx-npe.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/soc/ixp4xx/ixp4xx-npe.c b/drivers/soc/ixp4xx/ixp4xx-npe.c
index 5be9988f30ce..67384031ef97 100644
--- a/drivers/soc/ixp4xx/ixp4xx-npe.c
+++ b/drivers/soc/ixp4xx/ixp4xx-npe.c
@@ -700,9 +700,9 @@ static int ixp4xx_npe_probe(struct platform_device *pdev)
for (i = 0; i < NPE_COUNT; i++) {
struct npe *npe = &npe_tab[i];
- res = platform_get_resource(pdev, IORESOURCE_MEM, i);
- if (!res)
- return -ENODEV;
+ npe->regs = devm_platform_get_and_ioremap_resource(pdev, i, &res);
+ if (IS_ERR(npe->regs))
+ return PTR_ERR(npe->regs);
val = cpu_ixp4xx_features(rmap);
@@ -711,9 +711,6 @@ static int ixp4xx_npe_probe(struct platform_device *pdev)
i, res);
continue; /* NPE already disabled or not present */
}
- npe->regs = devm_ioremap_resource(dev, res);
- if (IS_ERR(npe->regs))
- return PTR_ERR(npe->regs);
npe->rmap = rmap;
if (npe_reset(npe)) {
--
2.39.0
Powered by blists - more mailing lists