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

From: Samuel Holland
Date: Wed Apr 10 2024 - 19:22:40 EST


This simplifies the code with no functional change.

Signed-off-by: Samuel Holland <samuel.holland@xxxxxxxxxx>
---

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