Skip to contentSkip to conversation

cpufreq: pmac32: Use of_property_read_reg() to parse "reg"

PATCH In review Rob Herring 2 participants 4 messages Jun 9, 2023 – Aug 23, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpufreq: pmac32: Use of_property_read_reg() to parse "reg"

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

---
 drivers/cpufreq/pmac32-cpufreq.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/cpufreq/pmac32-cpufreq.c +2 -3
index ec75e79659ac..f53635ba16c1 100644
@@ -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
Signature · 1 line
2.39.2
#1 lore raw
Quoted 8 lines · Rob Herring

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

---
 drivers/cpufreq/pmac32-cpufreq.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Ping!

Quoted 21 lines
drivers/cpufreq/pmac32-cpufreq.c +2 -4
index ec75e79659ac..f53635ba16c1 100644
@@ -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

maintainer Acked-by on v1 1/1
#2 lore raw
In reply to Rob Herring
Quoted 15 lines · Rob Herring

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

---
 drivers/cpufreq/pmac32-cpufreq.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/cpufreq/pmac32-cpufreq.c +0 -0
index ec75e79659ac..f53635ba16c1 100644
@@ -378,10 +378,9 @@ static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy)
 
 static u32 read_gpio(struct device_node *np)

drivers/cpufreq/pmac32-cpufreq.c static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy) · line 386

Quoted 10 lines
drivers/cpufreq/pmac32-cpufreq.c +2 -3
 {
-	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
Signature · 1 line
viresh
#3 lore raw
Quoted 22 lines · Viresh Kumar
Quoted 20 lines · Rob Herring

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

---
 drivers/cpufreq/pmac32-cpufreq.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/cpufreq/pmac32-cpufreq.c +1 -2
index ec75e79659ac..f53635ba16c1 100644
@@ -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;
 
Quoted 7 lines

drivers/cpufreq/pmac32-cpufreq.c static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy) · line 386

Quoted 5 lines
drivers/cpufreq/pmac32-cpufreq.c +1 -1
-     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

Is someone going to apply this?

Rob