[7/7] bus: omap_l3_noc: Convert to devm_platform_ioremap_resource()

Message ID 20230706072042.31296-7-frank.li@vivo.com
State New
Headers
Series [1/7] bus: sunxi-rsb: Convert to devm_platform_ioremap_resource() |

Commit Message

李扬韬 July 6, 2023, 7:20 a.m. UTC
  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(-)
  

Patch

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++;
 	}