[PATCH 2/4] cache: sifive_ccache: Use of_iomap() helper

Samuel Holland samuel.holland at sifive.com
Wed Apr 10 16:22:04 PDT 2024


This simplifies the code with no functional change.

Signed-off-by: Samuel Holland <samuel.holland at sifive.com>
---

 drivers/cache/sifive_ccache.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/cache/sifive_ccache.c b/drivers/cache/sifive_ccache.c
index 6874b72ec59d..9833e9f6f36c 100644
--- a/drivers/cache/sifive_ccache.c
+++ b/drivers/cache/sifive_ccache.c
@@ -288,7 +288,6 @@ static struct platform_driver sifive_ccache_driver = {
 static int __init sifive_ccache_init(void)
 {
 	struct device_node *np;
-	struct resource res;
 	const struct of_device_id *match;
 	unsigned long quirks __maybe_unused;
 	int rc;
@@ -299,12 +298,7 @@ static int __init sifive_ccache_init(void)
 
 	quirks = (uintptr_t)match->data;
 
-	if (of_address_to_resource(np, 0, &res)) {
-		rc = -ENODEV;
-		goto err_node_put;
-	}
-
-	ccache_base = ioremap(res.start, resource_size(&res));
+	ccache_base = of_iomap(np, 0);
 	if (!ccache_base) {
 		rc = -ENOMEM;
 		goto err_node_put;
-- 
2.44.0




More information about the linux-riscv mailing list