[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230706072042.31296-7-frank.li@vivo.com>
Date: Thu, 6 Jul 2023 15:20:42 +0800
From: Yangtao Li <frank.li@...o.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Yangtao Li <frank.li@...o.com>, linux-kernel@...r.kernel.org
Subject: [PATCH 7/7] bus: omap_l3_noc: Convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code.
Signed-off-by: Yangtao Li <frank.li@...o.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
Powered by blists - more mailing lists