lkml.org 
[lkml]   [2023]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 7/7] bus: omap_l3_noc: Convert to devm_platform_ioremap_resource()
Date
Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/bus/omap_l3_noc.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/bus/omap_l3_noc.c b/drivers/bus/omap_l3_noc.c
index eb1ba6319fda..0137e9ec577a 100644
--- a/drivers/bus/omap_l3_noc.c
+++ b/drivers/bus/omap_l3_noc.c
@@ -255,20 +255,15 @@ static int omap_l3_probe(struct platform_device *pdev)

/* Get mem resources */
for (i = 0, res_idx = 0; i < l3->num_modules; i++) {
- struct resource *res;
-
if (l3->l3_base[i] == L3_BASE_IS_SUBMODULE) {
/* First entry cannot be submodule */
BUG_ON(i == 0);
l3->l3_base[i] = l3->l3_base[i - 1];
continue;
}
- res = platform_get_resource(pdev, IORESOURCE_MEM, res_idx);
- l3->l3_base[i] = devm_ioremap_resource(&pdev->dev, res);
- if (IS_ERR(l3->l3_base[i])) {
- dev_err(l3->dev, "ioremap %d failed\n", i);
+ l3->l3_base[i] = devm_platform_ioremap_resource(pdev, res_idx);
+ if (IS_ERR(l3->l3_base[i]))
return PTR_ERR(l3->l3_base[i]);
- }
res_idx++;
}

--
2.39.0
\
 
 \ /
  Last update: 2023-07-06 09:21    [W:0.118 / U:23.516 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site