mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Russell King <linux@armlinux.org.uk>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Alim Akhtar <alim.akhtar@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] ARM: EXYNOS: Use of_address_to_resource()
Date: Sun, 19 Mar 2023 11:31:44 -0500	[thread overview]
Message-ID: <20230319163145.225323-1-robh@kernel.org> (raw)

Replace of_get_address() and of_translate_address() with single call
to of_address_to_resource(). With this, use ioremap() instead of
of_iomap() which would parse "reg" a second time.

Signed-off-by: Rob Herring <robh@kernel.org>
---
 arch/arm/mach-exynos/exynos.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index 51a247ca4da8..966a0995e047 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -50,11 +50,13 @@ void __init exynos_sysram_init(void)
 	struct device_node *node;
 
 	for_each_compatible_node(node, NULL, "samsung,exynos4210-sysram") {
+		struct resource res;
 		if (!of_device_is_available(node))
 			continue;
-		sysram_base_addr = of_iomap(node, 0);
-		sysram_base_phys = of_translate_address(node,
-					   of_get_address(node, 0, NULL, NULL));
+
+		of_address_to_resource(node, 0, &res);
+		sysram_base_addr = ioremap(res.start, resource_size(&res));
+		sysram_base_phys = res.start;
 		of_node_put(node);
 		break;
 	}
-- 
2.39.2


             reply	other threads:[~2023-03-19 16:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-19 16:31 Rob Herring [this message]
2023-03-22 17:48 ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230319163145.225323-1-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=alim.akhtar@samsung.com \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®