lkml.org 
[lkml]   [2023]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 6/6] soc: ixp4xx/npe: Use devm_platform_get_and_ioremap_resource()
Date
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>
---
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
\
 
 \ /
  Last update: 2023-07-05 14:28    [W:0.301 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site