LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH] cpufreq: pmac32: Use of_property_read_reg() to parse "reg"
@ 2023-06-09 18:31 Rob Herring
  2023-06-30 21:02 ` Rob Herring
  2023-07-03  3:01 ` Viresh Kumar
  0 siblings, 2 replies; 4+ messages in thread
From: Rob Herring @ 2023-06-09 18:31 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar, Michael Ellerman,
	Nicholas Piggin, Christophe Leroy
  Cc: linux-pm, linuxppc-dev, linux-kernel

Use the recently added of_property_read_reg() helper to get the
untranslated "reg" address value.

Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/cpufreq/pmac32-cpufreq.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/pmac32-cpufreq.c b/drivers/cpufreq/pmac32-cpufreq.c
index ec75e79659ac..f53635ba16c1 100644
--- a/drivers/cpufreq/pmac32-cpufreq.c
+++ b/drivers/cpufreq/pmac32-cpufreq.c
@@ -378,10 +378,9 @@ static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy)
 
 static u32 read_gpio(struct device_node *np)
 {
-	const u32 *reg = of_get_property(np, "reg", NULL);
-	u32 offset;
+	u64 offset;
 
-	if (reg == NULL)
+	if (of_property_read_reg(np, 0, &offset, NULL) < 0)
 		return 0;
 	/* That works for all keylargos but shall be fixed properly
 	 * some day... The problem is that it seems we can't rely
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-23 19:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-09 18:31 [PATCH] cpufreq: pmac32: Use of_property_read_reg() to parse "reg" Rob Herring
2023-06-30 21:02 ` Rob Herring
2023-07-03  3:01 ` Viresh Kumar
2023-08-23 19:07   ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).