Commit b9a663c4 authored by Rob Herring's avatar Rob Herring Committed by Viresh Kumar

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.
Signed-off-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent aa01dd7b
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/device.h> #include <linux/device.h>
#include <linux/hardirq.h> #include <linux/hardirq.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_address.h>
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/irq.h> #include <asm/irq.h>
...@@ -378,10 +379,9 @@ static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy) ...@@ -378,10 +379,9 @@ static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy)
static u32 read_gpio(struct device_node *np) static u32 read_gpio(struct device_node *np)
{ {
const u32 *reg = of_get_property(np, "reg", NULL); u64 offset;
u32 offset;
if (reg == NULL) if (of_property_read_reg(np, 0, &offset, NULL) < 0)
return 0; return 0;
/* That works for all keylargos but shall be fixed properly /* That works for all keylargos but shall be fixed properly
* some day... The problem is that it seems we can't rely * some day... The problem is that it seems we can't rely
...@@ -389,7 +389,6 @@ static u32 read_gpio(struct device_node *np) ...@@ -389,7 +389,6 @@ static u32 read_gpio(struct device_node *np)
* relative to the base of KeyLargo or to the base of the * relative to the base of KeyLargo or to the base of the
* GPIO space, and the device-tree doesn't help. * GPIO space, and the device-tree doesn't help.
*/ */
offset = *reg;
if (offset < KEYLARGO_GPIO_LEVELS0) if (offset < KEYLARGO_GPIO_LEVELS0)
offset += KEYLARGO_GPIO_LEVELS0; offset += KEYLARGO_GPIO_LEVELS0;
return offset; return offset;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment