aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2007-04-29 02:29:08 -0400
committerPaul Mackerras <paulus@samba.org>2007-04-29 21:02:05 -0400
commit12d371a69e6df96cd949af6bcb569e978e8f9d41 (patch)
tree30ed043c2d262b1bf25cbc0a1e19111dc7ac407e /arch
parent8d1cea6e1439a113b1f17eab9b4e2f0cfc24bbb0 (diff)
[POWERPC] get_property cleanups
Just another pass through arch/powerpc for old usages. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/cell/ras.c4
-rw-r--r--arch/powerpc/platforms/pasemi/cpufreq.c11
-rw-r--r--arch/powerpc/platforms/pasemi/gpio_mdio.c6
-rw-r--r--arch/powerpc/sysdev/uic.c8
4 files changed, 15 insertions, 14 deletions
diff --git a/arch/powerpc/platforms/cell/ras.c b/arch/powerpc/platforms/cell/ras.c
index b5ebc916388b..3961a085b432 100644
--- a/arch/powerpc/platforms/cell/ras.c
+++ b/arch/powerpc/platforms/cell/ras.c
@@ -149,7 +149,7 @@ static int __init cbe_ptcal_enable(void)
149 if (!np) 149 if (!np)
150 return -ENODEV; 150 return -ENODEV;
151 151
152 size = get_property(np, "ibm,cbe-ptcal-size", NULL); 152 size = of_get_property(np, "ibm,cbe-ptcal-size", NULL);
153 if (!size) 153 if (!size)
154 return -ENODEV; 154 return -ENODEV;
155 155
@@ -168,7 +168,7 @@ static int __init cbe_ptcal_enable(void)
168 168
169 /* support for older device tree - use cpu nodes */ 169 /* support for older device tree - use cpu nodes */
170 for_each_node_by_type(np, "cpu") { 170 for_each_node_by_type(np, "cpu") {
171 const u32 *nid = get_property(np, "node-id", NULL); 171 const u32 *nid = of_get_property(np, "node-id", NULL);
172 if (!nid) { 172 if (!nid) {
173 printk(KERN_ERR "%s: node %s is missing node-id?\n", 173 printk(KERN_ERR "%s: node %s is missing node-id?\n",
174 __FUNCTION__, np->full_name); 174 __FUNCTION__, np->full_name);
diff --git a/arch/powerpc/platforms/pasemi/cpufreq.c b/arch/powerpc/platforms/pasemi/cpufreq.c
index 4dd5c512f869..2a57d6023685 100644
--- a/arch/powerpc/platforms/pasemi/cpufreq.c
+++ b/arch/powerpc/platforms/pasemi/cpufreq.c
@@ -134,7 +134,8 @@ void restore_astate(int cpu)
134 134
135static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy) 135static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy)
136{ 136{
137 u32 *max_freq; 137 const u32 *max_freqp;
138 u32 max_freq;
138 int i, cur_astate; 139 int i, cur_astate;
139 struct resource res; 140 struct resource res;
140 struct device_node *cpu, *dn; 141 struct device_node *cpu, *dn;
@@ -175,16 +176,16 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy)
175 176
176 pr_debug("init cpufreq on CPU %d\n", policy->cpu); 177 pr_debug("init cpufreq on CPU %d\n", policy->cpu);
177 178
178 max_freq = (u32*) get_property(cpu, "clock-frequency", NULL); 179 max_freqp = of_get_property(cpu, "clock-frequency", NULL);
179 if (!max_freq) { 180 if (!max_freqp) {
180 err = -EINVAL; 181 err = -EINVAL;
181 goto out_unmap_sdcpwr; 182 goto out_unmap_sdcpwr;
182 } 183 }
183 184
184 /* we need the freq in kHz */ 185 /* we need the freq in kHz */
185 *max_freq /= 1000; 186 max_freq = *max_freqp / 1000;
186 187
187 pr_debug("max clock-frequency is at %u kHz\n", *max_freq); 188 pr_debug("max clock-frequency is at %u kHz\n", max_freq);
188 pr_debug("initializing frequency table\n"); 189 pr_debug("initializing frequency table\n");
189 190
190 /* initialize frequency table */ 191 /* initialize frequency table */
diff --git a/arch/powerpc/platforms/pasemi/gpio_mdio.c b/arch/powerpc/platforms/pasemi/gpio_mdio.c
index b1d3b6b420ae..c91a33593bb8 100644
--- a/arch/powerpc/platforms/pasemi/gpio_mdio.c
+++ b/arch/powerpc/platforms/pasemi/gpio_mdio.c
@@ -258,7 +258,7 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev,
258 new_bus->write = &gpio_mdio_write, 258 new_bus->write = &gpio_mdio_write,
259 new_bus->reset = &gpio_mdio_reset, 259 new_bus->reset = &gpio_mdio_reset,
260 260
261 prop = get_property(np, "reg", NULL); 261 prop = of_get_property(np, "reg", NULL);
262 new_bus->id = *prop; 262 new_bus->id = *prop;
263 new_bus->priv = priv; 263 new_bus->priv = priv;
264 264
@@ -269,10 +269,10 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev,
269 new_bus->irq[i] = irq_create_mapping(NULL, 10); 269 new_bus->irq[i] = irq_create_mapping(NULL, 10);
270 270
271 271
272 prop = get_property(np, "mdc-pin", NULL); 272 prop = of_get_property(np, "mdc-pin", NULL);
273 priv->mdc_pin = *prop; 273 priv->mdc_pin = *prop;
274 274
275 prop = get_property(np, "mdio-pin", NULL); 275 prop = of_get_property(np, "mdio-pin", NULL);
276 priv->mdio_pin = *prop; 276 priv->mdio_pin = *prop;
277 277
278 new_bus->dev = dev; 278 new_bus->dev = dev;
diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c
index cdbe68437afe..968fb40af9dc 100644
--- a/arch/powerpc/sysdev/uic.c
+++ b/arch/powerpc/sysdev/uic.c
@@ -230,7 +230,7 @@ static struct uic * __init uic_init_one(struct device_node *node)
230 memset(uic, 0, sizeof(*uic)); 230 memset(uic, 0, sizeof(*uic));
231 spin_lock_init(&uic->lock); 231 spin_lock_init(&uic->lock);
232 uic->of_node = of_node_get(node); 232 uic->of_node = of_node_get(node);
233 indexp = get_property(node, "cell-index", &len); 233 indexp = of_get_property(node, "cell-index", &len);
234 if (!indexp || (len != sizeof(u32))) { 234 if (!indexp || (len != sizeof(u32))) {
235 printk(KERN_ERR "uic: Device node %s has missing or invalid " 235 printk(KERN_ERR "uic: Device node %s has missing or invalid "
236 "cell-index property\n", node->full_name); 236 "cell-index property\n", node->full_name);
@@ -238,7 +238,7 @@ static struct uic * __init uic_init_one(struct device_node *node)
238 } 238 }
239 uic->index = *indexp; 239 uic->index = *indexp;
240 240
241 dcrreg = get_property(node, "dcr-reg", &len); 241 dcrreg = of_get_property(node, "dcr-reg", &len);
242 if (!dcrreg || (len != 2*sizeof(u32))) { 242 if (!dcrreg || (len != 2*sizeof(u32))) {
243 printk(KERN_ERR "uic: Device node %s has missing or invalid " 243 printk(KERN_ERR "uic: Device node %s has missing or invalid "
244 "dcr-reg property\n", node->full_name); 244 "dcr-reg property\n", node->full_name);
@@ -278,7 +278,7 @@ void __init uic_init_tree(void)
278 278
279 np = of_find_compatible_node(NULL, NULL, "ibm,uic"); 279 np = of_find_compatible_node(NULL, NULL, "ibm,uic");
280 while (np) { 280 while (np) {
281 interrupts = get_property(np, "interrupts", NULL); 281 interrupts = of_get_property(np, "interrupts", NULL);
282 if (! interrupts) 282 if (! interrupts)
283 break; 283 break;
284 284
@@ -297,7 +297,7 @@ void __init uic_init_tree(void)
297 /* The scan again for cascaded UICs */ 297 /* The scan again for cascaded UICs */
298 np = of_find_compatible_node(NULL, NULL, "ibm,uic"); 298 np = of_find_compatible_node(NULL, NULL, "ibm,uic");
299 while (np) { 299 while (np) {
300 interrupts = get_property(np, "interrupts", NULL); 300 interrupts = of_get_property(np, "interrupts", NULL);
301 if (interrupts) { 301 if (interrupts) {
302 /* Secondary UIC */ 302 /* Secondary UIC */
303 int cascade_virq; 303 int cascade_virq;