diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2007-04-03 08:26:41 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-04-12 13:55:19 -0400 |
commit | e2eb63927bfcb54232163bfec32440246fd44457 (patch) | |
tree | 596656edeb2332b5134d8236fa50b87f2c0ece29 /arch | |
parent | ceef87782a9452eeeca774e65d7f4e06455780a3 (diff) |
[POWERPC] Rename get_property to of_get_property: arch/powerpc
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
93 files changed, 420 insertions, 409 deletions
diff --git a/arch/powerpc/kernel/btext.c b/arch/powerpc/kernel/btext.c index 3678997339d6..e7b684689e04 100644 --- a/arch/powerpc/kernel/btext.c +++ b/arch/powerpc/kernel/btext.c | |||
@@ -161,33 +161,33 @@ int btext_initialize(struct device_node *np) | |||
161 | unsigned long address = 0; | 161 | unsigned long address = 0; |
162 | const u32 *prop; | 162 | const u32 *prop; |
163 | 163 | ||
164 | prop = get_property(np, "linux,bootx-width", NULL); | 164 | prop = of_get_property(np, "linux,bootx-width", NULL); |
165 | if (prop == NULL) | 165 | if (prop == NULL) |
166 | prop = get_property(np, "width", NULL); | 166 | prop = of_get_property(np, "width", NULL); |
167 | if (prop == NULL) | 167 | if (prop == NULL) |
168 | return -EINVAL; | 168 | return -EINVAL; |
169 | width = *prop; | 169 | width = *prop; |
170 | prop = get_property(np, "linux,bootx-height", NULL); | 170 | prop = of_get_property(np, "linux,bootx-height", NULL); |
171 | if (prop == NULL) | 171 | if (prop == NULL) |
172 | prop = get_property(np, "height", NULL); | 172 | prop = of_get_property(np, "height", NULL); |
173 | if (prop == NULL) | 173 | if (prop == NULL) |
174 | return -EINVAL; | 174 | return -EINVAL; |
175 | height = *prop; | 175 | height = *prop; |
176 | prop = get_property(np, "linux,bootx-depth", NULL); | 176 | prop = of_get_property(np, "linux,bootx-depth", NULL); |
177 | if (prop == NULL) | 177 | if (prop == NULL) |
178 | prop = get_property(np, "depth", NULL); | 178 | prop = of_get_property(np, "depth", NULL); |
179 | if (prop == NULL) | 179 | if (prop == NULL) |
180 | return -EINVAL; | 180 | return -EINVAL; |
181 | depth = *prop; | 181 | depth = *prop; |
182 | pitch = width * ((depth + 7) / 8); | 182 | pitch = width * ((depth + 7) / 8); |
183 | prop = get_property(np, "linux,bootx-linebytes", NULL); | 183 | prop = of_get_property(np, "linux,bootx-linebytes", NULL); |
184 | if (prop == NULL) | 184 | if (prop == NULL) |
185 | prop = get_property(np, "linebytes", NULL); | 185 | prop = of_get_property(np, "linebytes", NULL); |
186 | if (prop && *prop != 0xffffffffu) | 186 | if (prop && *prop != 0xffffffffu) |
187 | pitch = *prop; | 187 | pitch = *prop; |
188 | if (pitch == 1) | 188 | if (pitch == 1) |
189 | pitch = 0x1000; | 189 | pitch = 0x1000; |
190 | prop = get_property(np, "address", NULL); | 190 | prop = of_get_property(np, "address", NULL); |
191 | if (prop) | 191 | if (prop) |
192 | address = *prop; | 192 | address = *prop; |
193 | 193 | ||
@@ -219,7 +219,7 @@ int __init btext_find_display(int allow_nonstdout) | |||
219 | struct device_node *np = NULL; | 219 | struct device_node *np = NULL; |
220 | int rc = -ENODEV; | 220 | int rc = -ENODEV; |
221 | 221 | ||
222 | name = get_property(of_chosen, "linux,stdout-path", NULL); | 222 | name = of_get_property(of_chosen, "linux,stdout-path", NULL); |
223 | if (name != NULL) { | 223 | if (name != NULL) { |
224 | np = of_find_node_by_path(name); | 224 | np = of_find_node_by_path(name); |
225 | if (np != NULL) { | 225 | if (np != NULL) { |
@@ -236,7 +236,7 @@ int __init btext_find_display(int allow_nonstdout) | |||
236 | return rc; | 236 | return rc; |
237 | 237 | ||
238 | for (np = NULL; (np = of_find_node_by_type(np, "display"));) { | 238 | for (np = NULL; (np = of_find_node_by_type(np, "display"));) { |
239 | if (get_property(np, "linux,opened", NULL)) { | 239 | if (of_get_property(np, "linux,opened", NULL)) { |
240 | printk("trying %s ...\n", np->full_name); | 240 | printk("trying %s ...\n", np->full_name); |
241 | rc = btext_initialize(np); | 241 | rc = btext_initialize(np); |
242 | printk("result: %d\n", rc); | 242 | printk("result: %d\n", rc); |
diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c index 8ed1163c0bd4..48446a699ef8 100644 --- a/arch/powerpc/kernel/ibmebus.c +++ b/arch/powerpc/kernel/ibmebus.c | |||
@@ -193,7 +193,7 @@ static struct ibmebus_dev* __devinit ibmebus_register_device_node( | |||
193 | const char *loc_code; | 193 | const char *loc_code; |
194 | int length; | 194 | int length; |
195 | 195 | ||
196 | loc_code = get_property(dn, "ibm,loc-code", NULL); | 196 | loc_code = of_get_property(dn, "ibm,loc-code", NULL); |
197 | if (!loc_code) { | 197 | if (!loc_code) { |
198 | printk(KERN_WARNING "%s: node %s missing 'ibm,loc-code'\n", | 198 | printk(KERN_WARNING "%s: node %s missing 'ibm,loc-code'\n", |
199 | __FUNCTION__, dn->name ? dn->name : "<unknown>"); | 199 | __FUNCTION__, dn->name ? dn->name : "<unknown>"); |
@@ -256,12 +256,11 @@ static void ibmebus_add_devices_by_id(struct of_device_id *idt) | |||
256 | static int ibmebus_match_helper_name(struct device *dev, void *data) | 256 | static int ibmebus_match_helper_name(struct device *dev, void *data) |
257 | { | 257 | { |
258 | const struct ibmebus_dev *ebus_dev = to_ibmebus_dev(dev); | 258 | const struct ibmebus_dev *ebus_dev = to_ibmebus_dev(dev); |
259 | char *name; | 259 | const char *name; |
260 | 260 | ||
261 | name = (char*)get_property( | 261 | name = of_get_property(ebus_dev->ofdev.node, "name", NULL); |
262 | ebus_dev->ofdev.node, "name", NULL); | ||
263 | 262 | ||
264 | if (name && (strcmp((char*)data, name) == 0)) | 263 | if (name && (strcmp(data, name) == 0)) |
265 | return 1; | 264 | return 1; |
266 | 265 | ||
267 | return 0; | 266 | return 0; |
@@ -363,7 +362,7 @@ static ssize_t name_show(struct device *dev, | |||
363 | struct device_attribute *attr, char *buf) | 362 | struct device_attribute *attr, char *buf) |
364 | { | 363 | { |
365 | struct ibmebus_dev *ebus_dev = to_ibmebus_dev(dev); | 364 | struct ibmebus_dev *ebus_dev = to_ibmebus_dev(dev); |
366 | char *name = (char*)get_property(ebus_dev->ofdev.node, "name", NULL); | 365 | const char *name = of_get_property(ebus_dev->ofdev.node, "name", NULL); |
367 | return sprintf(buf, "%s\n", name); | 366 | return sprintf(buf, "%s\n", name); |
368 | } | 367 | } |
369 | 368 | ||
@@ -375,12 +374,11 @@ static struct device_attribute ibmebus_dev_attrs[] = { | |||
375 | static int ibmebus_match_helper_loc_code(struct device *dev, void *data) | 374 | static int ibmebus_match_helper_loc_code(struct device *dev, void *data) |
376 | { | 375 | { |
377 | const struct ibmebus_dev *ebus_dev = to_ibmebus_dev(dev); | 376 | const struct ibmebus_dev *ebus_dev = to_ibmebus_dev(dev); |
378 | char *loc_code; | 377 | const char *loc_code; |
379 | 378 | ||
380 | loc_code = (char*)get_property( | 379 | loc_code = of_get_property(ebus_dev->ofdev.node, "ibm,loc-code", NULL); |
381 | ebus_dev->ofdev.node, "ibm,loc-code", NULL); | ||
382 | 380 | ||
383 | if (loc_code && (strcmp((char*)data, loc_code) == 0)) | 381 | if (loc_code && (strcmp(data, loc_code) == 0)) |
384 | return 1; | 382 | return 1; |
385 | 383 | ||
386 | return 0; | 384 | return 0; |
@@ -391,7 +389,7 @@ static ssize_t ibmebus_store_probe(struct bus_type *bus, | |||
391 | { | 389 | { |
392 | struct device_node *dn = NULL; | 390 | struct device_node *dn = NULL; |
393 | struct ibmebus_dev *dev; | 391 | struct ibmebus_dev *dev; |
394 | char *loc_code; | 392 | const char *loc_code; |
395 | char parm[MAX_LOC_CODE_LENGTH]; | 393 | char parm[MAX_LOC_CODE_LENGTH]; |
396 | 394 | ||
397 | if (count >= MAX_LOC_CODE_LENGTH) | 395 | if (count >= MAX_LOC_CODE_LENGTH) |
@@ -409,7 +407,7 @@ static ssize_t ibmebus_store_probe(struct bus_type *bus, | |||
409 | } | 407 | } |
410 | 408 | ||
411 | while ((dn = of_find_all_nodes(dn))) { | 409 | while ((dn = of_find_all_nodes(dn))) { |
412 | loc_code = (char *)get_property(dn, "ibm,loc-code", NULL); | 410 | loc_code = of_get_property(dn, "ibm,loc-code", NULL); |
413 | if (loc_code && (strncmp(loc_code, parm, count) == 0)) { | 411 | if (loc_code && (strncmp(loc_code, parm, count) == 0)) { |
414 | dev = ibmebus_register_device_node(dn); | 412 | dev = ibmebus_register_device_node(dn); |
415 | if (IS_ERR(dev)) { | 413 | if (IS_ERR(dev)) { |
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c index 325f490a10cc..63dd2c3ad95e 100644 --- a/arch/powerpc/kernel/legacy_serial.c +++ b/arch/powerpc/kernel/legacy_serial.c | |||
@@ -44,12 +44,12 @@ static int __init add_legacy_port(struct device_node *np, int want_index, | |||
44 | int index; | 44 | int index; |
45 | 45 | ||
46 | /* get clock freq. if present */ | 46 | /* get clock freq. if present */ |
47 | clk = get_property(np, "clock-frequency", NULL); | 47 | clk = of_get_property(np, "clock-frequency", NULL); |
48 | if (clk && *clk) | 48 | if (clk && *clk) |
49 | clock = *clk; | 49 | clock = *clk; |
50 | 50 | ||
51 | /* get default speed if present */ | 51 | /* get default speed if present */ |
52 | spd = get_property(np, "current-speed", NULL); | 52 | spd = of_get_property(np, "current-speed", NULL); |
53 | 53 | ||
54 | /* If we have a location index, then try to use it */ | 54 | /* If we have a location index, then try to use it */ |
55 | if (want_index >= 0 && want_index < MAX_LEGACY_SERIAL_PORTS) | 55 | if (want_index >= 0 && want_index < MAX_LEGACY_SERIAL_PORTS) |
@@ -121,11 +121,11 @@ static int __init add_legacy_soc_port(struct device_node *np, | |||
121 | /* We only support ports that have a clock frequency properly | 121 | /* We only support ports that have a clock frequency properly |
122 | * encoded in the device-tree. | 122 | * encoded in the device-tree. |
123 | */ | 123 | */ |
124 | if (get_property(np, "clock-frequency", NULL) == NULL) | 124 | if (of_get_property(np, "clock-frequency", NULL) == NULL) |
125 | return -1; | 125 | return -1; |
126 | 126 | ||
127 | /* if rtas uses this device, don't try to use it as well */ | 127 | /* if rtas uses this device, don't try to use it as well */ |
128 | if (get_property(np, "used-by-rtas", NULL) != NULL) | 128 | if (of_get_property(np, "used-by-rtas", NULL) != NULL) |
129 | return -1; | 129 | return -1; |
130 | 130 | ||
131 | /* Get the address */ | 131 | /* Get the address */ |
@@ -157,7 +157,7 @@ static int __init add_legacy_isa_port(struct device_node *np, | |||
157 | DBG(" -> add_legacy_isa_port(%s)\n", np->full_name); | 157 | DBG(" -> add_legacy_isa_port(%s)\n", np->full_name); |
158 | 158 | ||
159 | /* Get the ISA port number */ | 159 | /* Get the ISA port number */ |
160 | reg = get_property(np, "reg", NULL); | 160 | reg = of_get_property(np, "reg", NULL); |
161 | if (reg == NULL) | 161 | if (reg == NULL) |
162 | return -1; | 162 | return -1; |
163 | 163 | ||
@@ -168,7 +168,7 @@ static int __init add_legacy_isa_port(struct device_node *np, | |||
168 | /* Now look for an "ibm,aix-loc" property that gives us ordering | 168 | /* Now look for an "ibm,aix-loc" property that gives us ordering |
169 | * if any... | 169 | * if any... |
170 | */ | 170 | */ |
171 | typep = get_property(np, "ibm,aix-loc", NULL); | 171 | typep = of_get_property(np, "ibm,aix-loc", NULL); |
172 | 172 | ||
173 | /* If we have a location index, then use it */ | 173 | /* If we have a location index, then use it */ |
174 | if (typep && *typep == 'S') | 174 | if (typep && *typep == 'S') |
@@ -206,7 +206,7 @@ static int __init add_legacy_pci_port(struct device_node *np, | |||
206 | * compatible UARTs on PCI need all sort of quirks (port offsets | 206 | * compatible UARTs on PCI need all sort of quirks (port offsets |
207 | * etc...) that this code doesn't know about | 207 | * etc...) that this code doesn't know about |
208 | */ | 208 | */ |
209 | if (get_property(np, "clock-frequency", NULL) == NULL) | 209 | if (of_get_property(np, "clock-frequency", NULL) == NULL) |
210 | return -1; | 210 | return -1; |
211 | 211 | ||
212 | /* Get the PCI address. Assume BAR 0 */ | 212 | /* Get the PCI address. Assume BAR 0 */ |
@@ -232,7 +232,7 @@ static int __init add_legacy_pci_port(struct device_node *np, | |||
232 | * we get to their "reg" property | 232 | * we get to their "reg" property |
233 | */ | 233 | */ |
234 | if (np != pci_dev) { | 234 | if (np != pci_dev) { |
235 | const u32 *reg = get_property(np, "reg", NULL); | 235 | const u32 *reg = of_get_property(np, "reg", NULL); |
236 | if (reg && (*reg < 4)) | 236 | if (reg && (*reg < 4)) |
237 | index = lindex = *reg; | 237 | index = lindex = *reg; |
238 | } | 238 | } |
@@ -296,7 +296,7 @@ void __init find_legacy_serial_ports(void) | |||
296 | DBG(" -> find_legacy_serial_port()\n"); | 296 | DBG(" -> find_legacy_serial_port()\n"); |
297 | 297 | ||
298 | /* Now find out if one of these is out firmware console */ | 298 | /* Now find out if one of these is out firmware console */ |
299 | path = get_property(of_chosen, "linux,stdout-path", NULL); | 299 | path = of_get_property(of_chosen, "linux,stdout-path", NULL); |
300 | if (path != NULL) { | 300 | if (path != NULL) { |
301 | stdout = of_find_node_by_path(path); | 301 | stdout = of_find_node_by_path(path); |
302 | if (stdout) | 302 | if (stdout) |
@@ -529,7 +529,7 @@ static int __init check_legacy_serial_console(void) | |||
529 | } | 529 | } |
530 | /* We are getting a weird phandle from OF ... */ | 530 | /* We are getting a weird phandle from OF ... */ |
531 | /* ... So use the full path instead */ | 531 | /* ... So use the full path instead */ |
532 | name = get_property(of_chosen, "linux,stdout-path", NULL); | 532 | name = of_get_property(of_chosen, "linux,stdout-path", NULL); |
533 | if (name == NULL) { | 533 | if (name == NULL) { |
534 | DBG(" no linux,stdout-path !\n"); | 534 | DBG(" no linux,stdout-path !\n"); |
535 | return -ENODEV; | 535 | return -ENODEV; |
@@ -541,12 +541,12 @@ static int __init check_legacy_serial_console(void) | |||
541 | } | 541 | } |
542 | DBG("stdout is %s\n", prom_stdout->full_name); | 542 | DBG("stdout is %s\n", prom_stdout->full_name); |
543 | 543 | ||
544 | name = get_property(prom_stdout, "name", NULL); | 544 | name = of_get_property(prom_stdout, "name", NULL); |
545 | if (!name) { | 545 | if (!name) { |
546 | DBG(" stdout package has no name !\n"); | 546 | DBG(" stdout package has no name !\n"); |
547 | goto not_found; | 547 | goto not_found; |
548 | } | 548 | } |
549 | spd = get_property(prom_stdout, "current-speed", NULL); | 549 | spd = of_get_property(prom_stdout, "current-speed", NULL); |
550 | if (spd) | 550 | if (spd) |
551 | speed = *spd; | 551 | speed = *spd; |
552 | 552 | ||
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c index 89486b631284..b8dc1eeb0169 100644 --- a/arch/powerpc/kernel/lparcfg.c +++ b/arch/powerpc/kernel/lparcfg.c | |||
@@ -323,7 +323,7 @@ static int pseries_lparcfg_data(struct seq_file *m, void *v) | |||
323 | 323 | ||
324 | rtas_node = find_path_device("/rtas"); | 324 | rtas_node = find_path_device("/rtas"); |
325 | if (rtas_node) | 325 | if (rtas_node) |
326 | lrdrp = get_property(rtas_node, "ibm,lrdr-capacity", NULL); | 326 | lrdrp = of_get_property(rtas_node, "ibm,lrdr-capacity", NULL); |
327 | 327 | ||
328 | if (lrdrp == NULL) { | 328 | if (lrdrp == NULL) { |
329 | partition_potential_processors = vdso_data->processorCount; | 329 | partition_potential_processors = vdso_data->processorCount; |
@@ -539,21 +539,22 @@ static int lparcfg_data(struct seq_file *m, void *v) | |||
539 | 539 | ||
540 | rootdn = find_path_device("/"); | 540 | rootdn = find_path_device("/"); |
541 | if (rootdn) { | 541 | if (rootdn) { |
542 | tmp = get_property(rootdn, "model", NULL); | 542 | tmp = of_get_property(rootdn, "model", NULL); |
543 | if (tmp) { | 543 | if (tmp) { |
544 | model = tmp; | 544 | model = tmp; |
545 | /* Skip "IBM," - see platforms/iseries/dt.c */ | 545 | /* Skip "IBM," - see platforms/iseries/dt.c */ |
546 | if (firmware_has_feature(FW_FEATURE_ISERIES)) | 546 | if (firmware_has_feature(FW_FEATURE_ISERIES)) |
547 | model += 4; | 547 | model += 4; |
548 | } | 548 | } |
549 | tmp = get_property(rootdn, "system-id", NULL); | 549 | tmp = of_get_property(rootdn, "system-id", NULL); |
550 | if (tmp) { | 550 | if (tmp) { |
551 | system_id = tmp; | 551 | system_id = tmp; |
552 | /* Skip "IBM," - see platforms/iseries/dt.c */ | 552 | /* Skip "IBM," - see platforms/iseries/dt.c */ |
553 | if (firmware_has_feature(FW_FEATURE_ISERIES)) | 553 | if (firmware_has_feature(FW_FEATURE_ISERIES)) |
554 | system_id += 4; | 554 | system_id += 4; |
555 | } | 555 | } |
556 | lp_index_ptr = get_property(rootdn, "ibm,partition-no", NULL); | 556 | lp_index_ptr = of_get_property(rootdn, "ibm,partition-no", |
557 | NULL); | ||
557 | if (lp_index_ptr) | 558 | if (lp_index_ptr) |
558 | lp_index = *lp_index_ptr; | 559 | lp_index = *lp_index_ptr; |
559 | } | 560 | } |
diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c index b975b5b0e3d5..704375bda73a 100644 --- a/arch/powerpc/kernel/machine_kexec_64.c +++ b/arch/powerpc/kernel/machine_kexec_64.c | |||
@@ -72,8 +72,8 @@ int default_machine_kexec_prepare(struct kimage *image) | |||
72 | /* We also should not overwrite the tce tables */ | 72 | /* We also should not overwrite the tce tables */ |
73 | for (node = of_find_node_by_type(NULL, "pci"); node != NULL; | 73 | for (node = of_find_node_by_type(NULL, "pci"); node != NULL; |
74 | node = of_find_node_by_type(node, "pci")) { | 74 | node = of_find_node_by_type(node, "pci")) { |
75 | basep = get_property(node, "linux,tce-base", NULL); | 75 | basep = of_get_property(node, "linux,tce-base", NULL); |
76 | sizep = get_property(node, "linux,tce-size", NULL); | 76 | sizep = of_get_property(node, "linux,tce-size", NULL); |
77 | if (basep == NULL || sizep == NULL) | 77 | if (basep == NULL || sizep == NULL) |
78 | continue; | 78 | continue; |
79 | 79 | ||
diff --git a/arch/powerpc/kernel/of_platform.c b/arch/powerpc/kernel/of_platform.c index da78e44eefec..d2fd9863318c 100644 --- a/arch/powerpc/kernel/of_platform.c +++ b/arch/powerpc/kernel/of_platform.c | |||
@@ -178,7 +178,7 @@ static void of_platform_make_bus_id(struct of_device *dev) | |||
178 | * and 'D' for MMIO DCRs. | 178 | * and 'D' for MMIO DCRs. |
179 | */ | 179 | */ |
180 | #ifdef CONFIG_PPC_DCR | 180 | #ifdef CONFIG_PPC_DCR |
181 | reg = get_property(node, "dcr-reg", NULL); | 181 | reg = of_get_property(node, "dcr-reg", NULL); |
182 | if (reg) { | 182 | if (reg) { |
183 | #ifdef CONFIG_PPC_DCR_NATIVE | 183 | #ifdef CONFIG_PPC_DCR_NATIVE |
184 | snprintf(name, BUS_ID_SIZE, "d%x.%s", | 184 | snprintf(name, BUS_ID_SIZE, "d%x.%s", |
@@ -198,7 +198,7 @@ static void of_platform_make_bus_id(struct of_device *dev) | |||
198 | /* | 198 | /* |
199 | * For MMIO, get the physical address | 199 | * For MMIO, get the physical address |
200 | */ | 200 | */ |
201 | reg = get_property(node, "reg", NULL); | 201 | reg = of_get_property(node, "reg", NULL); |
202 | if (reg) { | 202 | if (reg) { |
203 | addr = of_translate_address(node, reg); | 203 | addr = of_translate_address(node, reg); |
204 | if (addr != OF_BAD_ADDR) { | 204 | if (addr != OF_BAD_ADDR) { |
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c index e99ffe2140bf..ae04f9418363 100644 --- a/arch/powerpc/kernel/pci_32.c +++ b/arch/powerpc/kernel/pci_32.c | |||
@@ -637,7 +637,7 @@ make_one_node_map(struct device_node* node, u8 pci_bus) | |||
637 | 637 | ||
638 | if (pci_bus >= pci_bus_count) | 638 | if (pci_bus >= pci_bus_count) |
639 | return; | 639 | return; |
640 | bus_range = get_property(node, "bus-range", &len); | 640 | bus_range = of_get_property(node, "bus-range", &len); |
641 | if (bus_range == NULL || len < 2 * sizeof(int)) { | 641 | if (bus_range == NULL || len < 2 * sizeof(int)) { |
642 | printk(KERN_WARNING "Can't get bus-range for %s, " | 642 | printk(KERN_WARNING "Can't get bus-range for %s, " |
643 | "assuming it starts at 0\n", node->full_name); | 643 | "assuming it starts at 0\n", node->full_name); |
@@ -649,11 +649,11 @@ make_one_node_map(struct device_node* node, u8 pci_bus) | |||
649 | struct pci_dev* dev; | 649 | struct pci_dev* dev; |
650 | const unsigned int *class_code, *reg; | 650 | const unsigned int *class_code, *reg; |
651 | 651 | ||
652 | class_code = get_property(node, "class-code", NULL); | 652 | class_code = of_get_property(node, "class-code", NULL); |
653 | if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI && | 653 | if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI && |
654 | (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) | 654 | (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) |
655 | continue; | 655 | continue; |
656 | reg = get_property(node, "reg", NULL); | 656 | reg = of_get_property(node, "reg", NULL); |
657 | if (!reg) | 657 | if (!reg) |
658 | continue; | 658 | continue; |
659 | dev = pci_find_slot(pci_bus, ((reg[0] >> 8) & 0xff)); | 659 | dev = pci_find_slot(pci_bus, ((reg[0] >> 8) & 0xff)); |
@@ -724,7 +724,7 @@ scan_OF_pci_childs(struct device_node* node, pci_OF_scan_iterator filter, void* | |||
724 | * a fake root for all functions of a multi-function device, | 724 | * a fake root for all functions of a multi-function device, |
725 | * we go down them as well. | 725 | * we go down them as well. |
726 | */ | 726 | */ |
727 | class_code = get_property(node, "class-code", NULL); | 727 | class_code = of_get_property(node, "class-code", NULL); |
728 | if ((!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI && | 728 | if ((!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI && |
729 | (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) && | 729 | (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) && |
730 | strcmp(node->name, "multifunc-device")) | 730 | strcmp(node->name, "multifunc-device")) |
@@ -744,7 +744,7 @@ static struct device_node *scan_OF_for_pci_dev(struct device_node *parent, | |||
744 | unsigned int psize; | 744 | unsigned int psize; |
745 | 745 | ||
746 | while ((np = of_get_next_child(parent, np)) != NULL) { | 746 | while ((np = of_get_next_child(parent, np)) != NULL) { |
747 | reg = get_property(np, "reg", &psize); | 747 | reg = of_get_property(np, "reg", &psize); |
748 | if (reg == NULL || psize < 4) | 748 | if (reg == NULL || psize < 4) |
749 | continue; | 749 | continue; |
750 | if (((reg[0] >> 8) & 0xff) == devfn) | 750 | if (((reg[0] >> 8) & 0xff) == devfn) |
@@ -859,7 +859,7 @@ pci_device_from_OF_node(struct device_node* node, u8* bus, u8* devfn) | |||
859 | if (!scan_OF_pci_childs(((struct device_node*)hose->arch_data)->child, | 859 | if (!scan_OF_pci_childs(((struct device_node*)hose->arch_data)->child, |
860 | find_OF_pci_device_filter, (void *)node)) | 860 | find_OF_pci_device_filter, (void *)node)) |
861 | return -ENODEV; | 861 | return -ENODEV; |
862 | reg = get_property(node, "reg", NULL); | 862 | reg = of_get_property(node, "reg", NULL); |
863 | if (!reg) | 863 | if (!reg) |
864 | return -ENODEV; | 864 | return -ENODEV; |
865 | *bus = (reg[0] >> 16) & 0xff; | 865 | *bus = (reg[0] >> 16) & 0xff; |
@@ -902,7 +902,7 @@ pci_process_bridge_OF_ranges(struct pci_controller *hose, | |||
902 | * that can have more than 3 ranges, fortunately using contiguous | 902 | * that can have more than 3 ranges, fortunately using contiguous |
903 | * addresses -- BenH | 903 | * addresses -- BenH |
904 | */ | 904 | */ |
905 | dt_ranges = get_property(dev, "ranges", &rlen); | 905 | dt_ranges = of_get_property(dev, "ranges", &rlen); |
906 | if (!dt_ranges) | 906 | if (!dt_ranges) |
907 | return; | 907 | return; |
908 | /* Sanity check, though hopefully that never happens */ | 908 | /* Sanity check, though hopefully that never happens */ |
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index 84b4f66e98b6..60d7d4baa227 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
@@ -268,7 +268,7 @@ static u32 get_int_prop(struct device_node *np, const char *name, u32 def) | |||
268 | const u32 *prop; | 268 | const u32 *prop; |
269 | int len; | 269 | int len; |
270 | 270 | ||
271 | prop = get_property(np, name, &len); | 271 | prop = of_get_property(np, name, &len); |
272 | if (prop && len >= 4) | 272 | if (prop && len >= 4) |
273 | return *prop; | 273 | return *prop; |
274 | return def; | 274 | return def; |
@@ -301,7 +301,7 @@ static void pci_parse_of_addrs(struct device_node *node, struct pci_dev *dev) | |||
301 | u32 i; | 301 | u32 i; |
302 | int proplen; | 302 | int proplen; |
303 | 303 | ||
304 | addrs = get_property(node, "assigned-addresses", &proplen); | 304 | addrs = of_get_property(node, "assigned-addresses", &proplen); |
305 | if (!addrs) | 305 | if (!addrs) |
306 | return; | 306 | return; |
307 | DBG(" parse addresses (%d bytes) @ %p\n", proplen, addrs); | 307 | DBG(" parse addresses (%d bytes) @ %p\n", proplen, addrs); |
@@ -343,7 +343,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node, | |||
343 | dev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL); | 343 | dev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL); |
344 | if (!dev) | 344 | if (!dev) |
345 | return NULL; | 345 | return NULL; |
346 | type = get_property(node, "device_type", NULL); | 346 | type = of_get_property(node, "device_type", NULL); |
347 | if (type == NULL) | 347 | if (type == NULL) |
348 | type = ""; | 348 | type = ""; |
349 | 349 | ||
@@ -407,7 +407,7 @@ void __devinit of_scan_bus(struct device_node *node, | |||
407 | 407 | ||
408 | while ((child = of_get_next_child(node, child)) != NULL) { | 408 | while ((child = of_get_next_child(node, child)) != NULL) { |
409 | DBG(" * %s\n", child->full_name); | 409 | DBG(" * %s\n", child->full_name); |
410 | reg = get_property(child, "reg", ®len); | 410 | reg = of_get_property(child, "reg", ®len); |
411 | if (reg == NULL || reglen < 20) | 411 | if (reg == NULL || reglen < 20) |
412 | continue; | 412 | continue; |
413 | devfn = (reg[0] >> 8) & 0xff; | 413 | devfn = (reg[0] >> 8) & 0xff; |
@@ -440,13 +440,13 @@ void __devinit of_scan_pci_bridge(struct device_node *node, | |||
440 | DBG("of_scan_pci_bridge(%s)\n", node->full_name); | 440 | DBG("of_scan_pci_bridge(%s)\n", node->full_name); |
441 | 441 | ||
442 | /* parse bus-range property */ | 442 | /* parse bus-range property */ |
443 | busrange = get_property(node, "bus-range", &len); | 443 | busrange = of_get_property(node, "bus-range", &len); |
444 | if (busrange == NULL || len != 8) { | 444 | if (busrange == NULL || len != 8) { |
445 | printk(KERN_DEBUG "Can't get bus-range for PCI-PCI bridge %s\n", | 445 | printk(KERN_DEBUG "Can't get bus-range for PCI-PCI bridge %s\n", |
446 | node->full_name); | 446 | node->full_name); |
447 | return; | 447 | return; |
448 | } | 448 | } |
449 | ranges = get_property(node, "ranges", &len); | 449 | ranges = of_get_property(node, "ranges", &len); |
450 | if (ranges == NULL) { | 450 | if (ranges == NULL) { |
451 | printk(KERN_DEBUG "Can't get ranges for PCI-PCI bridge %s\n", | 451 | printk(KERN_DEBUG "Can't get ranges for PCI-PCI bridge %s\n", |
452 | node->full_name); | 452 | node->full_name); |
@@ -910,7 +910,7 @@ static void __devinit pci_process_ISA_OF_ranges(struct device_node *isa_node, | |||
910 | unsigned int size; | 910 | unsigned int size; |
911 | int rlen = 0; | 911 | int rlen = 0; |
912 | 912 | ||
913 | range = get_property(isa_node, "ranges", &rlen); | 913 | range = of_get_property(isa_node, "ranges", &rlen); |
914 | if (range == NULL || (rlen < sizeof(struct isa_range))) { | 914 | if (range == NULL || (rlen < sizeof(struct isa_range))) { |
915 | printk(KERN_ERR "no ISA ranges or unexpected isa range size," | 915 | printk(KERN_ERR "no ISA ranges or unexpected isa range size," |
916 | "mapping 64k\n"); | 916 | "mapping 64k\n"); |
@@ -970,7 +970,7 @@ void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose, | |||
970 | * (size depending on dev->n_addr_cells) | 970 | * (size depending on dev->n_addr_cells) |
971 | * cells 4+5 or 5+6: the size of the range | 971 | * cells 4+5 or 5+6: the size of the range |
972 | */ | 972 | */ |
973 | ranges = get_property(dev, "ranges", &rlen); | 973 | ranges = of_get_property(dev, "ranges", &rlen); |
974 | if (ranges == NULL) | 974 | if (ranges == NULL) |
975 | return; | 975 | return; |
976 | hose->io_base_phys = 0; | 976 | hose->io_base_phys = 0; |
diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c index 68df018dae0e..d7d36df9c053 100644 --- a/arch/powerpc/kernel/pci_dn.c +++ b/arch/powerpc/kernel/pci_dn.c | |||
@@ -40,7 +40,8 @@ | |||
40 | static void * __devinit update_dn_pci_info(struct device_node *dn, void *data) | 40 | static void * __devinit update_dn_pci_info(struct device_node *dn, void *data) |
41 | { | 41 | { |
42 | struct pci_controller *phb = data; | 42 | struct pci_controller *phb = data; |
43 | const int *type = get_property(dn, "ibm,pci-config-space-type", NULL); | 43 | const int *type = |
44 | of_get_property(dn, "ibm,pci-config-space-type", NULL); | ||
44 | const u32 *regs; | 45 | const u32 *regs; |
45 | struct pci_dn *pdn; | 46 | struct pci_dn *pdn; |
46 | 47 | ||
@@ -54,14 +55,14 @@ static void * __devinit update_dn_pci_info(struct device_node *dn, void *data) | |||
54 | dn->data = pdn; | 55 | dn->data = pdn; |
55 | pdn->node = dn; | 56 | pdn->node = dn; |
56 | pdn->phb = phb; | 57 | pdn->phb = phb; |
57 | regs = get_property(dn, "reg", NULL); | 58 | regs = of_get_property(dn, "reg", NULL); |
58 | if (regs) { | 59 | if (regs) { |
59 | /* First register entry is addr (00BBSS00) */ | 60 | /* First register entry is addr (00BBSS00) */ |
60 | pdn->busno = (regs[0] >> 16) & 0xff; | 61 | pdn->busno = (regs[0] >> 16) & 0xff; |
61 | pdn->devfn = (regs[0] >> 8) & 0xff; | 62 | pdn->devfn = (regs[0] >> 8) & 0xff; |
62 | } | 63 | } |
63 | if (firmware_has_feature(FW_FEATURE_ISERIES)) { | 64 | if (firmware_has_feature(FW_FEATURE_ISERIES)) { |
64 | const u32 *busp = get_property(dn, "linux,subbus", NULL); | 65 | const u32 *busp = of_get_property(dn, "linux,subbus", NULL); |
65 | if (busp) | 66 | if (busp) |
66 | pdn->bussubno = *busp; | 67 | pdn->bussubno = *busp; |
67 | } | 68 | } |
@@ -100,7 +101,7 @@ void *traverse_pci_devices(struct device_node *start, traverse_func pre, | |||
100 | u32 class; | 101 | u32 class; |
101 | 102 | ||
102 | nextdn = NULL; | 103 | nextdn = NULL; |
103 | classp = get_property(dn, "class-code", NULL); | 104 | classp = of_get_property(dn, "class-code", NULL); |
104 | class = classp ? *classp : 0; | 105 | class = classp ? *classp : 0; |
105 | 106 | ||
106 | if (pre && ((ret = pre(dn, data)) != NULL)) | 107 | if (pre && ((ret = pre(dn, data)) != NULL)) |
diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c index ba9c7c1e4108..aa40a5307294 100644 --- a/arch/powerpc/kernel/prom_parse.c +++ b/arch/powerpc/kernel/prom_parse.c | |||
@@ -196,7 +196,7 @@ const u32 *of_get_pci_address(struct device_node *dev, int bar_no, u64 *size, | |||
196 | return NULL; | 196 | return NULL; |
197 | 197 | ||
198 | /* Get "reg" or "assigned-addresses" property */ | 198 | /* Get "reg" or "assigned-addresses" property */ |
199 | prop = get_property(dev, bus->addresses, &psize); | 199 | prop = of_get_property(dev, bus->addresses, &psize); |
200 | if (prop == NULL) | 200 | if (prop == NULL) |
201 | return NULL; | 201 | return NULL; |
202 | psize /= 4; | 202 | psize /= 4; |
@@ -438,7 +438,7 @@ static int of_translate_one(struct device_node *parent, struct of_bus *bus, | |||
438 | * to translate addresses that aren't supposed to be translated in | 438 | * to translate addresses that aren't supposed to be translated in |
439 | * the first place. --BenH. | 439 | * the first place. --BenH. |
440 | */ | 440 | */ |
441 | ranges = get_property(parent, "ranges", &rlen); | 441 | ranges = of_get_property(parent, "ranges", &rlen); |
442 | if (ranges == NULL || rlen == 0) { | 442 | if (ranges == NULL || rlen == 0) { |
443 | offset = of_read_number(addr, na); | 443 | offset = of_read_number(addr, na); |
444 | memset(addr, 0, pna * 4); | 444 | memset(addr, 0, pna * 4); |
@@ -578,7 +578,7 @@ const u32 *of_get_address(struct device_node *dev, int index, u64 *size, | |||
578 | return NULL; | 578 | return NULL; |
579 | 579 | ||
580 | /* Get "reg" or "assigned-addresses" property */ | 580 | /* Get "reg" or "assigned-addresses" property */ |
581 | prop = get_property(dev, bus->addresses, &psize); | 581 | prop = of_get_property(dev, bus->addresses, &psize); |
582 | if (prop == NULL) | 582 | if (prop == NULL) |
583 | return NULL; | 583 | return NULL; |
584 | psize /= 4; | 584 | psize /= 4; |
@@ -650,16 +650,16 @@ void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop, | |||
650 | /* busno is always one cell */ | 650 | /* busno is always one cell */ |
651 | *busno = *(dma_window++); | 651 | *busno = *(dma_window++); |
652 | 652 | ||
653 | prop = get_property(dn, "ibm,#dma-address-cells", NULL); | 653 | prop = of_get_property(dn, "ibm,#dma-address-cells", NULL); |
654 | if (!prop) | 654 | if (!prop) |
655 | prop = get_property(dn, "#address-cells", NULL); | 655 | prop = of_get_property(dn, "#address-cells", NULL); |
656 | 656 | ||
657 | cells = prop ? *(u32 *)prop : of_n_addr_cells(dn); | 657 | cells = prop ? *(u32 *)prop : of_n_addr_cells(dn); |
658 | *phys = of_read_number(dma_window, cells); | 658 | *phys = of_read_number(dma_window, cells); |
659 | 659 | ||
660 | dma_window += cells; | 660 | dma_window += cells; |
661 | 661 | ||
662 | prop = get_property(dn, "ibm,#dma-size-cells", NULL); | 662 | prop = of_get_property(dn, "ibm,#dma-size-cells", NULL); |
663 | cells = prop ? *(u32 *)prop : of_n_size_cells(dn); | 663 | cells = prop ? *(u32 *)prop : of_n_size_cells(dn); |
664 | *size = of_read_number(dma_window, cells); | 664 | *size = of_read_number(dma_window, cells); |
665 | } | 665 | } |
@@ -680,7 +680,7 @@ static struct device_node *of_irq_find_parent(struct device_node *child) | |||
680 | return NULL; | 680 | return NULL; |
681 | 681 | ||
682 | do { | 682 | do { |
683 | parp = get_property(child, "interrupt-parent", NULL); | 683 | parp = of_get_property(child, "interrupt-parent", NULL); |
684 | if (parp == NULL) | 684 | if (parp == NULL) |
685 | p = of_get_parent(child); | 685 | p = of_get_parent(child); |
686 | else { | 686 | else { |
@@ -691,7 +691,7 @@ static struct device_node *of_irq_find_parent(struct device_node *child) | |||
691 | } | 691 | } |
692 | of_node_put(child); | 692 | of_node_put(child); |
693 | child = p; | 693 | child = p; |
694 | } while (p && get_property(p, "#interrupt-cells", NULL) == NULL); | 694 | } while (p && of_get_property(p, "#interrupt-cells", NULL) == NULL); |
695 | 695 | ||
696 | return p; | 696 | return p; |
697 | } | 697 | } |
@@ -716,7 +716,7 @@ void of_irq_map_init(unsigned int flags) | |||
716 | struct device_node *np; | 716 | struct device_node *np; |
717 | 717 | ||
718 | for(np = NULL; (np = of_find_all_nodes(np)) != NULL;) { | 718 | for(np = NULL; (np = of_find_all_nodes(np)) != NULL;) { |
719 | if (get_property(np, "interrupt-controller", NULL) | 719 | if (of_get_property(np, "interrupt-controller", NULL) |
720 | == NULL) | 720 | == NULL) |
721 | continue; | 721 | continue; |
722 | /* Skip /chosen/interrupt-controller */ | 722 | /* Skip /chosen/interrupt-controller */ |
@@ -755,7 +755,7 @@ int of_irq_map_raw(struct device_node *parent, const u32 *intspec, u32 ointsize, | |||
755 | * is none, we are nice and just walk up the tree | 755 | * is none, we are nice and just walk up the tree |
756 | */ | 756 | */ |
757 | do { | 757 | do { |
758 | tmp = get_property(ipar, "#interrupt-cells", NULL); | 758 | tmp = of_get_property(ipar, "#interrupt-cells", NULL); |
759 | if (tmp != NULL) { | 759 | if (tmp != NULL) { |
760 | intsize = *tmp; | 760 | intsize = *tmp; |
761 | break; | 761 | break; |
@@ -779,7 +779,7 @@ int of_irq_map_raw(struct device_node *parent, const u32 *intspec, u32 ointsize, | |||
779 | */ | 779 | */ |
780 | old = of_node_get(ipar); | 780 | old = of_node_get(ipar); |
781 | do { | 781 | do { |
782 | tmp = get_property(old, "#address-cells", NULL); | 782 | tmp = of_get_property(old, "#address-cells", NULL); |
783 | tnode = of_get_parent(old); | 783 | tnode = of_get_parent(old); |
784 | of_node_put(old); | 784 | of_node_put(old); |
785 | old = tnode; | 785 | old = tnode; |
@@ -795,7 +795,8 @@ int of_irq_map_raw(struct device_node *parent, const u32 *intspec, u32 ointsize, | |||
795 | /* Now check if cursor is an interrupt-controller and if it is | 795 | /* Now check if cursor is an interrupt-controller and if it is |
796 | * then we are done | 796 | * then we are done |
797 | */ | 797 | */ |
798 | if (get_property(ipar, "interrupt-controller", NULL) != NULL) { | 798 | if (of_get_property(ipar, "interrupt-controller", NULL) != |
799 | NULL) { | ||
799 | DBG(" -> got it !\n"); | 800 | DBG(" -> got it !\n"); |
800 | memcpy(out_irq->specifier, intspec, | 801 | memcpy(out_irq->specifier, intspec, |
801 | intsize * sizeof(u32)); | 802 | intsize * sizeof(u32)); |
@@ -806,7 +807,7 @@ int of_irq_map_raw(struct device_node *parent, const u32 *intspec, u32 ointsize, | |||
806 | } | 807 | } |
807 | 808 | ||
808 | /* Now look for an interrupt-map */ | 809 | /* Now look for an interrupt-map */ |
809 | imap = get_property(ipar, "interrupt-map", &imaplen); | 810 | imap = of_get_property(ipar, "interrupt-map", &imaplen); |
810 | /* No interrupt map, check for an interrupt parent */ | 811 | /* No interrupt map, check for an interrupt parent */ |
811 | if (imap == NULL) { | 812 | if (imap == NULL) { |
812 | DBG(" -> no map, getting parent\n"); | 813 | DBG(" -> no map, getting parent\n"); |
@@ -816,7 +817,7 @@ int of_irq_map_raw(struct device_node *parent, const u32 *intspec, u32 ointsize, | |||
816 | imaplen /= sizeof(u32); | 817 | imaplen /= sizeof(u32); |
817 | 818 | ||
818 | /* Look for a mask */ | 819 | /* Look for a mask */ |
819 | imask = get_property(ipar, "interrupt-map-mask", NULL); | 820 | imask = of_get_property(ipar, "interrupt-map-mask", NULL); |
820 | 821 | ||
821 | /* If we were passed no "reg" property and we attempt to parse | 822 | /* If we were passed no "reg" property and we attempt to parse |
822 | * an interrupt-map, then #address-cells must be 0. | 823 | * an interrupt-map, then #address-cells must be 0. |
@@ -863,15 +864,13 @@ int of_irq_map_raw(struct device_node *parent, const u32 *intspec, u32 ointsize, | |||
863 | /* Get #interrupt-cells and #address-cells of new | 864 | /* Get #interrupt-cells and #address-cells of new |
864 | * parent | 865 | * parent |
865 | */ | 866 | */ |
866 | tmp = get_property(newpar, "#interrupt-cells", | 867 | tmp = of_get_property(newpar, "#interrupt-cells", NULL); |
867 | NULL); | ||
868 | if (tmp == NULL) { | 868 | if (tmp == NULL) { |
869 | DBG(" -> parent lacks #interrupt-cells !\n"); | 869 | DBG(" -> parent lacks #interrupt-cells !\n"); |
870 | goto fail; | 870 | goto fail; |
871 | } | 871 | } |
872 | newintsize = *tmp; | 872 | newintsize = *tmp; |
873 | tmp = get_property(newpar, "#address-cells", | 873 | tmp = of_get_property(newpar, "#address-cells", NULL); |
874 | NULL); | ||
875 | newaddrsize = (tmp == NULL) ? 0 : *tmp; | 874 | newaddrsize = (tmp == NULL) ? 0 : *tmp; |
876 | 875 | ||
877 | DBG(" -> newintsize=%d, newaddrsize=%d\n", | 876 | DBG(" -> newintsize=%d, newaddrsize=%d\n", |
@@ -928,7 +927,7 @@ static int of_irq_map_oldworld(struct device_node *device, int index, | |||
928 | * everything together on these) | 927 | * everything together on these) |
929 | */ | 928 | */ |
930 | while (device) { | 929 | while (device) { |
931 | ints = get_property(device, "AAPL,interrupts", &intlen); | 930 | ints = of_get_property(device, "AAPL,interrupts", &intlen); |
932 | if (ints != NULL) | 931 | if (ints != NULL) |
933 | break; | 932 | break; |
934 | device = device->parent; | 933 | device = device->parent; |
@@ -970,13 +969,13 @@ int of_irq_map_one(struct device_node *device, int index, struct of_irq *out_irq | |||
970 | return of_irq_map_oldworld(device, index, out_irq); | 969 | return of_irq_map_oldworld(device, index, out_irq); |
971 | 970 | ||
972 | /* Get the interrupts property */ | 971 | /* Get the interrupts property */ |
973 | intspec = get_property(device, "interrupts", &intlen); | 972 | intspec = of_get_property(device, "interrupts", &intlen); |
974 | if (intspec == NULL) | 973 | if (intspec == NULL) |
975 | return -EINVAL; | 974 | return -EINVAL; |
976 | intlen /= sizeof(u32); | 975 | intlen /= sizeof(u32); |
977 | 976 | ||
978 | /* Get the reg property (if any) */ | 977 | /* Get the reg property (if any) */ |
979 | addr = get_property(device, "reg", NULL); | 978 | addr = of_get_property(device, "reg", NULL); |
980 | 979 | ||
981 | /* Look for the interrupt parent. */ | 980 | /* Look for the interrupt parent. */ |
982 | p = of_irq_find_parent(device); | 981 | p = of_irq_find_parent(device); |
@@ -984,7 +983,7 @@ int of_irq_map_one(struct device_node *device, int index, struct of_irq *out_irq | |||
984 | return -EINVAL; | 983 | return -EINVAL; |
985 | 984 | ||
986 | /* Get size of interrupt specifier */ | 985 | /* Get size of interrupt specifier */ |
987 | tmp = get_property(p, "#interrupt-cells", NULL); | 986 | tmp = of_get_property(p, "#interrupt-cells", NULL); |
988 | if (tmp == NULL) { | 987 | if (tmp == NULL) { |
989 | of_node_put(p); | 988 | of_node_put(p); |
990 | return -EINVAL; | 989 | return -EINVAL; |
diff --git a/arch/powerpc/kernel/rtas-proc.c b/arch/powerpc/kernel/rtas-proc.c index 6cbf2ae5d7aa..190b7ed1dbfb 100644 --- a/arch/powerpc/kernel/rtas-proc.c +++ b/arch/powerpc/kernel/rtas-proc.c | |||
@@ -450,7 +450,7 @@ static int ppc_rtas_sensors_show(struct seq_file *m, void *v) | |||
450 | int llen, offs; | 450 | int llen, offs; |
451 | 451 | ||
452 | sprintf (rstr, SENSOR_PREFIX"%04d", p->token); | 452 | sprintf (rstr, SENSOR_PREFIX"%04d", p->token); |
453 | loc = get_property(rtas_node, rstr, &llen); | 453 | loc = of_get_property(rtas_node, rstr, &llen); |
454 | 454 | ||
455 | /* A sensor may have multiple instances */ | 455 | /* A sensor may have multiple instances */ |
456 | for (j = 0, offs = 0; j <= p->quant; j++) { | 456 | for (j = 0, offs = 0; j <= p->quant; j++) { |
@@ -477,7 +477,7 @@ static int ppc_rtas_find_all_sensors(void) | |||
477 | const unsigned int *utmp; | 477 | const unsigned int *utmp; |
478 | int len, i; | 478 | int len, i; |
479 | 479 | ||
480 | utmp = get_property(rtas_node, "rtas-sensors", &len); | 480 | utmp = of_get_property(rtas_node, "rtas-sensors", &len); |
481 | if (utmp == NULL) { | 481 | if (utmp == NULL) { |
482 | printk (KERN_ERR "error: could not get rtas-sensors\n"); | 482 | printk (KERN_ERR "error: could not get rtas-sensors\n"); |
483 | return 1; | 483 | return 1; |
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c index 9d0735a54564..702fecc93204 100644 --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c | |||
@@ -193,16 +193,16 @@ void rtas_progress(char *s, unsigned short hex) | |||
193 | if (display_width == 0) { | 193 | if (display_width == 0) { |
194 | display_width = 0x10; | 194 | display_width = 0x10; |
195 | if ((root = find_path_device("/rtas"))) { | 195 | if ((root = find_path_device("/rtas"))) { |
196 | if ((p = get_property(root, | 196 | if ((p = of_get_property(root, |
197 | "ibm,display-line-length", NULL))) | 197 | "ibm,display-line-length", NULL))) |
198 | display_width = *p; | 198 | display_width = *p; |
199 | if ((p = get_property(root, | 199 | if ((p = of_get_property(root, |
200 | "ibm,form-feed", NULL))) | 200 | "ibm,form-feed", NULL))) |
201 | form_feed = *p; | 201 | form_feed = *p; |
202 | if ((p = get_property(root, | 202 | if ((p = of_get_property(root, |
203 | "ibm,display-number-of-lines", NULL))) | 203 | "ibm,display-number-of-lines", NULL))) |
204 | display_lines = *p; | 204 | display_lines = *p; |
205 | row_width = get_property(root, | 205 | row_width = of_get_property(root, |
206 | "ibm,display-truncation-length", NULL); | 206 | "ibm,display-truncation-length", NULL); |
207 | } | 207 | } |
208 | display_character = rtas_token("display-character"); | 208 | display_character = rtas_token("display-character"); |
@@ -298,7 +298,7 @@ int rtas_token(const char *service) | |||
298 | const int *tokp; | 298 | const int *tokp; |
299 | if (rtas.dev == NULL) | 299 | if (rtas.dev == NULL) |
300 | return RTAS_UNKNOWN_SERVICE; | 300 | return RTAS_UNKNOWN_SERVICE; |
301 | tokp = get_property(rtas.dev, service, NULL); | 301 | tokp = of_get_property(rtas.dev, service, NULL); |
302 | return tokp ? *tokp : RTAS_UNKNOWN_SERVICE; | 302 | return tokp ? *tokp : RTAS_UNKNOWN_SERVICE; |
303 | } | 303 | } |
304 | EXPORT_SYMBOL(rtas_token); | 304 | EXPORT_SYMBOL(rtas_token); |
@@ -832,12 +832,12 @@ void __init rtas_initialize(void) | |||
832 | if (rtas.dev) { | 832 | if (rtas.dev) { |
833 | const u32 *basep, *entryp, *sizep; | 833 | const u32 *basep, *entryp, *sizep; |
834 | 834 | ||
835 | basep = get_property(rtas.dev, "linux,rtas-base", NULL); | 835 | basep = of_get_property(rtas.dev, "linux,rtas-base", NULL); |
836 | sizep = get_property(rtas.dev, "rtas-size", NULL); | 836 | sizep = of_get_property(rtas.dev, "rtas-size", NULL); |
837 | if (basep != NULL && sizep != NULL) { | 837 | if (basep != NULL && sizep != NULL) { |
838 | rtas.base = *basep; | 838 | rtas.base = *basep; |
839 | rtas.size = *sizep; | 839 | rtas.size = *sizep; |
840 | entryp = get_property(rtas.dev, | 840 | entryp = of_get_property(rtas.dev, |
841 | "linux,rtas-entry", NULL); | 841 | "linux,rtas-entry", NULL); |
842 | if (entryp == NULL) /* Ugh */ | 842 | if (entryp == NULL) /* Ugh */ |
843 | rtas.entry = rtas.base; | 843 | rtas.entry = rtas.base; |
diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c index 1616a44ac608..f2286822be09 100644 --- a/arch/powerpc/kernel/rtas_pci.c +++ b/arch/powerpc/kernel/rtas_pci.c | |||
@@ -60,7 +60,7 @@ static int of_device_available(struct device_node * dn) | |||
60 | { | 60 | { |
61 | const char *status; | 61 | const char *status; |
62 | 62 | ||
63 | status = get_property(dn, "status", NULL); | 63 | status = of_get_property(dn, "status", NULL); |
64 | 64 | ||
65 | if (!status) | 65 | if (!status) |
66 | return 1; | 66 | return 1; |
@@ -177,7 +177,7 @@ struct pci_ops rtas_pci_ops = { | |||
177 | 177 | ||
178 | int is_python(struct device_node *dev) | 178 | int is_python(struct device_node *dev) |
179 | { | 179 | { |
180 | const char *model = get_property(dev, "model", NULL); | 180 | const char *model = of_get_property(dev, "model", NULL); |
181 | 181 | ||
182 | if (model && strstr(model, "Python")) | 182 | if (model && strstr(model, "Python")) |
183 | return 1; | 183 | return 1; |
@@ -247,7 +247,7 @@ static int phb_set_bus_ranges(struct device_node *dev, | |||
247 | const int *bus_range; | 247 | const int *bus_range; |
248 | unsigned int len; | 248 | unsigned int len; |
249 | 249 | ||
250 | bus_range = get_property(dev, "bus-range", &len); | 250 | bus_range = of_get_property(dev, "bus-range", &len); |
251 | if (bus_range == NULL || len < 2 * sizeof(int)) { | 251 | if (bus_range == NULL || len < 2 * sizeof(int)) { |
252 | return 1; | 252 | return 1; |
253 | } | 253 | } |
@@ -309,12 +309,12 @@ void __init find_and_init_phbs(void) | |||
309 | if (of_chosen) { | 309 | if (of_chosen) { |
310 | const int *prop; | 310 | const int *prop; |
311 | 311 | ||
312 | prop = get_property(of_chosen, | 312 | prop = of_get_property(of_chosen, |
313 | "linux,pci-probe-only", NULL); | 313 | "linux,pci-probe-only", NULL); |
314 | if (prop) | 314 | if (prop) |
315 | pci_probe_only = *prop; | 315 | pci_probe_only = *prop; |
316 | 316 | ||
317 | prop = get_property(of_chosen, | 317 | prop = of_get_property(of_chosen, |
318 | "linux,pci-assign-all-buses", NULL); | 318 | "linux,pci-assign-all-buses", NULL); |
319 | if (prop) | 319 | if (prop) |
320 | pci_assign_all_buses = *prop; | 320 | pci_assign_all_buses = *prop; |
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 640ff0d8f83c..3c8847b647fa 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c | |||
@@ -352,11 +352,12 @@ void __init smp_setup_cpu_maps(void) | |||
352 | const int *intserv; | 352 | const int *intserv; |
353 | int j, len = sizeof(u32), nthreads = 1; | 353 | int j, len = sizeof(u32), nthreads = 1; |
354 | 354 | ||
355 | intserv = get_property(dn, "ibm,ppc-interrupt-server#s", &len); | 355 | intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s", |
356 | &len); | ||
356 | if (intserv) | 357 | if (intserv) |
357 | nthreads = len / sizeof(int); | 358 | nthreads = len / sizeof(int); |
358 | else { | 359 | else { |
359 | intserv = get_property(dn, "reg", NULL); | 360 | intserv = of_get_property(dn, "reg", NULL); |
360 | if (!intserv) | 361 | if (!intserv) |
361 | intserv = &cpu; /* assume logical == phys */ | 362 | intserv = &cpu; /* assume logical == phys */ |
362 | } | 363 | } |
@@ -382,7 +383,7 @@ void __init smp_setup_cpu_maps(void) | |||
382 | num_addr_cell = of_n_addr_cells(dn); | 383 | num_addr_cell = of_n_addr_cells(dn); |
383 | num_size_cell = of_n_size_cells(dn); | 384 | num_size_cell = of_n_size_cells(dn); |
384 | 385 | ||
385 | ireg = get_property(dn, "ibm,lrdr-capacity", NULL); | 386 | ireg = of_get_property(dn, "ibm,lrdr-capacity", NULL); |
386 | 387 | ||
387 | if (!ireg) | 388 | if (!ireg) |
388 | goto out; | 389 | goto out; |
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index 3c0c7f435844..22083ce3cc30 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
@@ -109,7 +109,7 @@ static void check_smt_enabled(void) | |||
109 | dn = of_find_node_by_path("/options"); | 109 | dn = of_find_node_by_path("/options"); |
110 | 110 | ||
111 | if (dn) { | 111 | if (dn) { |
112 | smt_option = get_property(dn, "ibm,smt-enabled", NULL); | 112 | smt_option = of_get_property(dn, "ibm,smt-enabled", NULL); |
113 | 113 | ||
114 | if (smt_option) { | 114 | if (smt_option) { |
115 | if (!strcmp(smt_option, "on")) | 115 | if (!strcmp(smt_option, "on")) |
@@ -304,10 +304,10 @@ static void __init initialize_cache_info(void) | |||
304 | 304 | ||
305 | size = 0; | 305 | size = 0; |
306 | lsize = cur_cpu_spec->dcache_bsize; | 306 | lsize = cur_cpu_spec->dcache_bsize; |
307 | sizep = get_property(np, "d-cache-size", NULL); | 307 | sizep = of_get_property(np, "d-cache-size", NULL); |
308 | if (sizep != NULL) | 308 | if (sizep != NULL) |
309 | size = *sizep; | 309 | size = *sizep; |
310 | lsizep = get_property(np, dc, NULL); | 310 | lsizep = of_get_property(np, dc, NULL); |
311 | if (lsizep != NULL) | 311 | if (lsizep != NULL) |
312 | lsize = *lsizep; | 312 | lsize = *lsizep; |
313 | if (sizep == 0 || lsizep == 0) | 313 | if (sizep == 0 || lsizep == 0) |
@@ -321,10 +321,10 @@ static void __init initialize_cache_info(void) | |||
321 | 321 | ||
322 | size = 0; | 322 | size = 0; |
323 | lsize = cur_cpu_spec->icache_bsize; | 323 | lsize = cur_cpu_spec->icache_bsize; |
324 | sizep = get_property(np, "i-cache-size", NULL); | 324 | sizep = of_get_property(np, "i-cache-size", NULL); |
325 | if (sizep != NULL) | 325 | if (sizep != NULL) |
326 | size = *sizep; | 326 | size = *sizep; |
327 | lsizep = get_property(np, ic, NULL); | 327 | lsizep = of_get_property(np, ic, NULL); |
328 | if (lsizep != NULL) | 328 | if (lsizep != NULL) |
329 | lsize = *lsizep; | 329 | lsize = *lsizep; |
330 | if (sizep == 0 || lsizep == 0) | 330 | if (sizep == 0 || lsizep == 0) |
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c index d57818aea081..476f1d546056 100644 --- a/arch/powerpc/kernel/sysfs.c +++ b/arch/powerpc/kernel/sysfs.c | |||
@@ -70,7 +70,7 @@ static int __init smt_setup(void) | |||
70 | if (!options) | 70 | if (!options) |
71 | return -ENODEV; | 71 | return -ENODEV; |
72 | 72 | ||
73 | val = get_property(options, "ibm,smt-snooze-delay", NULL); | 73 | val = of_get_property(options, "ibm,smt-snooze-delay", NULL); |
74 | if (!smt_snooze_cmdline && val) { | 74 | if (!smt_snooze_cmdline && val) { |
75 | for_each_possible_cpu(cpu) | 75 | for_each_possible_cpu(cpu) |
76 | per_cpu(smt_snooze_delay, cpu) = *val; | 76 | per_cpu(smt_snooze_delay, cpu) = *val; |
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index f6f0c6b07c4c..7cedef8f5f70 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c | |||
@@ -834,7 +834,7 @@ static int __init get_freq(char *name, int cells, unsigned long *val) | |||
834 | cpu = of_find_node_by_type(NULL, "cpu"); | 834 | cpu = of_find_node_by_type(NULL, "cpu"); |
835 | 835 | ||
836 | if (cpu) { | 836 | if (cpu) { |
837 | fp = get_property(cpu, name, NULL); | 837 | fp = of_get_property(cpu, name, NULL); |
838 | if (fp) { | 838 | if (fp) { |
839 | found = 1; | 839 | found = 1; |
840 | *val = of_read_ulong(fp, cells); | 840 | *val = of_read_ulong(fp, cells); |
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c index 2968ffeafdb6..a09277a8639f 100644 --- a/arch/powerpc/kernel/vio.c +++ b/arch/powerpc/kernel/vio.c | |||
@@ -81,7 +81,7 @@ static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev) | |||
81 | struct iommu_table *tbl; | 81 | struct iommu_table *tbl; |
82 | unsigned long offset, size; | 82 | unsigned long offset, size; |
83 | 83 | ||
84 | dma_window = get_property(dev->dev.archdata.of_node, | 84 | dma_window = of_get_property(dev->dev.archdata.of_node, |
85 | "ibm,my-dma-window", NULL); | 85 | "ibm,my-dma-window", NULL); |
86 | if (!dma_window) | 86 | if (!dma_window) |
87 | return NULL; | 87 | return NULL; |
@@ -226,7 +226,7 @@ struct vio_dev * __devinit vio_register_device_node(struct device_node *of_node) | |||
226 | return NULL; | 226 | return NULL; |
227 | } | 227 | } |
228 | 228 | ||
229 | unit_address = get_property(of_node, "reg", NULL); | 229 | unit_address = of_get_property(of_node, "reg", NULL); |
230 | if (unit_address == NULL) { | 230 | if (unit_address == NULL) { |
231 | printk(KERN_WARNING "%s: node %s missing 'reg'\n", | 231 | printk(KERN_WARNING "%s: node %s missing 'reg'\n", |
232 | __FUNCTION__, | 232 | __FUNCTION__, |
@@ -246,7 +246,7 @@ struct vio_dev * __devinit vio_register_device_node(struct device_node *of_node) | |||
246 | viodev->type = of_node->type; | 246 | viodev->type = of_node->type; |
247 | viodev->unit_address = *unit_address; | 247 | viodev->unit_address = *unit_address; |
248 | if (firmware_has_feature(FW_FEATURE_ISERIES)) { | 248 | if (firmware_has_feature(FW_FEATURE_ISERIES)) { |
249 | unit_address = get_property(of_node, | 249 | unit_address = of_get_property(of_node, |
250 | "linux,unit_address", NULL); | 250 | "linux,unit_address", NULL); |
251 | if (unit_address != NULL) | 251 | if (unit_address != NULL) |
252 | viodev->unit_address = *unit_address; | 252 | viodev->unit_address = *unit_address; |
@@ -377,7 +377,7 @@ static int vio_hotplug(struct device *dev, char **envp, int num_envp, | |||
377 | dn = dev->archdata.of_node; | 377 | dn = dev->archdata.of_node; |
378 | if (!dn) | 378 | if (!dn) |
379 | return -ENODEV; | 379 | return -ENODEV; |
380 | cp = get_property(dn, "compatible", &length); | 380 | cp = of_get_property(dn, "compatible", &length); |
381 | if (!cp) | 381 | if (!cp) |
382 | return -ENODEV; | 382 | return -ENODEV; |
383 | 383 | ||
@@ -406,12 +406,12 @@ struct bus_type vio_bus_type = { | |||
406 | * @which: The property/attribute to be extracted. | 406 | * @which: The property/attribute to be extracted. |
407 | * @length: Pointer to length of returned data size (unused if NULL). | 407 | * @length: Pointer to length of returned data size (unused if NULL). |
408 | * | 408 | * |
409 | * Calls prom.c's get_property() to return the value of the | 409 | * Calls prom.c's of_get_property() to return the value of the |
410 | * attribute specified by @which | 410 | * attribute specified by @which |
411 | */ | 411 | */ |
412 | const void *vio_get_attribute(struct vio_dev *vdev, char *which, int *length) | 412 | const void *vio_get_attribute(struct vio_dev *vdev, char *which, int *length) |
413 | { | 413 | { |
414 | return get_property(vdev->dev.archdata.of_node, which, length); | 414 | return of_get_property(vdev->dev.archdata.of_node, which, length); |
415 | } | 415 | } |
416 | EXPORT_SYMBOL(vio_get_attribute); | 416 | EXPORT_SYMBOL(vio_get_attribute); |
417 | 417 | ||
@@ -443,7 +443,7 @@ struct vio_dev *vio_find_node(struct device_node *vnode) | |||
443 | char kobj_name[BUS_ID_SIZE]; | 443 | char kobj_name[BUS_ID_SIZE]; |
444 | 444 | ||
445 | /* construct the kobject name from the device node */ | 445 | /* construct the kobject name from the device node */ |
446 | unit_address = get_property(vnode, "reg", NULL); | 446 | unit_address = of_get_property(vnode, "reg", NULL); |
447 | if (!unit_address) | 447 | if (!unit_address) |
448 | return NULL; | 448 | return NULL; |
449 | snprintf(kobj_name, BUS_ID_SIZE, "%x", *unit_address); | 449 | snprintf(kobj_name, BUS_ID_SIZE, "%x", *unit_address); |
diff --git a/arch/powerpc/mm/hash_native_64.c b/arch/powerpc/mm/hash_native_64.c index 6f1016acdbf6..79aedaf36f2b 100644 --- a/arch/powerpc/mm/hash_native_64.c +++ b/arch/powerpc/mm/hash_native_64.c | |||
@@ -505,7 +505,7 @@ static inline int tlb_batching_enabled(void) | |||
505 | int enabled = 1; | 505 | int enabled = 1; |
506 | 506 | ||
507 | if (root) { | 507 | if (root) { |
508 | const char *model = get_property(root, "model", NULL); | 508 | const char *model = of_get_property(root, "model", NULL); |
509 | if (model && !strcmp(model, "IBM,9076-N81")) | 509 | if (model && !strcmp(model, "IBM,9076-N81")) |
510 | enabled = 0; | 510 | enabled = 0; |
511 | of_node_put(root); | 511 | of_node_put(root); |
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 683839b2b06b..b3a592b25ab3 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -74,7 +74,7 @@ static struct device_node * __cpuinit find_cpu_node(unsigned int cpu) | |||
74 | 74 | ||
75 | while ((cpu_node = of_find_node_by_type(cpu_node, "cpu")) != NULL) { | 75 | while ((cpu_node = of_find_node_by_type(cpu_node, "cpu")) != NULL) { |
76 | /* Try interrupt server first */ | 76 | /* Try interrupt server first */ |
77 | interrupt_server = get_property(cpu_node, | 77 | interrupt_server = of_get_property(cpu_node, |
78 | "ibm,ppc-interrupt-server#s", &len); | 78 | "ibm,ppc-interrupt-server#s", &len); |
79 | 79 | ||
80 | len = len / sizeof(u32); | 80 | len = len / sizeof(u32); |
@@ -85,7 +85,7 @@ static struct device_node * __cpuinit find_cpu_node(unsigned int cpu) | |||
85 | return cpu_node; | 85 | return cpu_node; |
86 | } | 86 | } |
87 | } else { | 87 | } else { |
88 | reg = get_property(cpu_node, "reg", &len); | 88 | reg = of_get_property(cpu_node, "reg", &len); |
89 | if (reg && (len > 0) && (reg[0] == hw_cpuid)) | 89 | if (reg && (len > 0) && (reg[0] == hw_cpuid)) |
90 | return cpu_node; | 90 | return cpu_node; |
91 | } | 91 | } |
@@ -97,7 +97,7 @@ static struct device_node * __cpuinit find_cpu_node(unsigned int cpu) | |||
97 | /* must hold reference to node during call */ | 97 | /* must hold reference to node during call */ |
98 | static const int *of_get_associativity(struct device_node *dev) | 98 | static const int *of_get_associativity(struct device_node *dev) |
99 | { | 99 | { |
100 | return get_property(dev, "ibm,associativity", NULL); | 100 | return of_get_property(dev, "ibm,associativity", NULL); |
101 | } | 101 | } |
102 | 102 | ||
103 | /* Returns nid in the range [0..MAX_NUMNODES-1], or -1 if no useful numa | 103 | /* Returns nid in the range [0..MAX_NUMNODES-1], or -1 if no useful numa |
@@ -179,7 +179,7 @@ static int __init find_min_common_depth(void) | |||
179 | * configuration (should be all 0's) and the second is for a normal | 179 | * configuration (should be all 0's) and the second is for a normal |
180 | * NUMA configuration. | 180 | * NUMA configuration. |
181 | */ | 181 | */ |
182 | ref_points = get_property(rtas_root, | 182 | ref_points = of_get_property(rtas_root, |
183 | "ibm,associativity-reference-points", &len); | 183 | "ibm,associativity-reference-points", &len); |
184 | 184 | ||
185 | if ((len >= 1) && ref_points) { | 185 | if ((len >= 1) && ref_points) { |
@@ -308,9 +308,9 @@ static void __init parse_drconf_memory(struct device_node *memory) | |||
308 | int nid, default_nid = 0; | 308 | int nid, default_nid = 0; |
309 | unsigned int start, ai, flags; | 309 | unsigned int start, ai, flags; |
310 | 310 | ||
311 | lm = get_property(memory, "ibm,lmb-size", &ls); | 311 | lm = of_get_property(memory, "ibm,lmb-size", &ls); |
312 | dm = get_property(memory, "ibm,dynamic-memory", &ld); | 312 | dm = of_get_property(memory, "ibm,dynamic-memory", &ld); |
313 | aa = get_property(memory, "ibm,associativity-lookup-arrays", &la); | 313 | aa = of_get_property(memory, "ibm,associativity-lookup-arrays", &la); |
314 | if (!lm || !dm || !aa || | 314 | if (!lm || !dm || !aa || |
315 | ls < sizeof(unsigned int) || ld < sizeof(unsigned int) || | 315 | ls < sizeof(unsigned int) || ld < sizeof(unsigned int) || |
316 | la < 2 * sizeof(unsigned int)) | 316 | la < 2 * sizeof(unsigned int)) |
@@ -404,10 +404,10 @@ static int __init parse_numa_properties(void) | |||
404 | const unsigned int *memcell_buf; | 404 | const unsigned int *memcell_buf; |
405 | unsigned int len; | 405 | unsigned int len; |
406 | 406 | ||
407 | memcell_buf = get_property(memory, | 407 | memcell_buf = of_get_property(memory, |
408 | "linux,usable-memory", &len); | 408 | "linux,usable-memory", &len); |
409 | if (!memcell_buf || len <= 0) | 409 | if (!memcell_buf || len <= 0) |
410 | memcell_buf = get_property(memory, "reg", &len); | 410 | memcell_buf = of_get_property(memory, "reg", &len); |
411 | if (!memcell_buf || len <= 0) | 411 | if (!memcell_buf || len <= 0) |
412 | continue; | 412 | continue; |
413 | 413 | ||
@@ -725,7 +725,7 @@ int hot_add_scn_to_nid(unsigned long scn_addr) | |||
725 | const unsigned int *memcell_buf; | 725 | const unsigned int *memcell_buf; |
726 | unsigned int len; | 726 | unsigned int len; |
727 | 727 | ||
728 | memcell_buf = get_property(memory, "reg", &len); | 728 | memcell_buf = of_get_property(memory, "reg", &len); |
729 | if (!memcell_buf || len <= 0) | 729 | if (!memcell_buf || len <= 0) |
730 | continue; | 730 | continue; |
731 | 731 | ||
diff --git a/arch/powerpc/platforms/52xx/efika.c b/arch/powerpc/platforms/52xx/efika.c index 31a2a8ca1de7..042008486969 100644 --- a/arch/powerpc/platforms/52xx/efika.c +++ b/arch/powerpc/platforms/52xx/efika.c | |||
@@ -113,7 +113,7 @@ void __init efika_pcisetup(void) | |||
113 | return; | 113 | return; |
114 | } | 114 | } |
115 | 115 | ||
116 | bus_range = get_property(pcictrl, "bus-range", &len); | 116 | bus_range = of_get_property(pcictrl, "bus-range", &len); |
117 | if (bus_range == NULL || len < 2 * sizeof(int)) { | 117 | if (bus_range == NULL || len < 2 * sizeof(int)) { |
118 | printk(KERN_WARNING EFIKA_PLATFORM_NAME | 118 | printk(KERN_WARNING EFIKA_PLATFORM_NAME |
119 | ": Can't get bus-range for %s\n", pcictrl->full_name); | 119 | ": Can't get bus-range for %s\n", pcictrl->full_name); |
@@ -159,18 +159,17 @@ void __init efika_pcisetup(void) | |||
159 | static void efika_show_cpuinfo(struct seq_file *m) | 159 | static void efika_show_cpuinfo(struct seq_file *m) |
160 | { | 160 | { |
161 | struct device_node *root; | 161 | struct device_node *root; |
162 | const char *revision = NULL; | 162 | const char *revision; |
163 | const char *codegendescription = NULL; | 163 | const char *codegendescription; |
164 | const char *codegenvendor = NULL; | 164 | const char *codegenvendor; |
165 | 165 | ||
166 | root = of_find_node_by_path("/"); | 166 | root = of_find_node_by_path("/"); |
167 | if (!root) | 167 | if (!root) |
168 | return; | 168 | return; |
169 | 169 | ||
170 | revision = get_property(root, "revision", NULL); | 170 | revision = of_get_property(root, "revision", NULL); |
171 | codegendescription = | 171 | codegendescription = of_get_property(root, "CODEGEN,description", NULL); |
172 | get_property(root, "CODEGEN,description", NULL); | 172 | codegenvendor = of_get_property(root, "CODEGEN,vendor", NULL); |
173 | codegenvendor = get_property(root, "CODEGEN,vendor", NULL); | ||
174 | 173 | ||
175 | if (codegendescription) | 174 | if (codegendescription) |
176 | seq_printf(m, "machine\t\t: %s\n", codegendescription); | 175 | seq_printf(m, "machine\t\t: %s\n", codegendescription); |
diff --git a/arch/powerpc/platforms/52xx/lite5200.c b/arch/powerpc/platforms/52xx/lite5200.c index cc3b40de21dd..4f5ebaadcb50 100644 --- a/arch/powerpc/platforms/52xx/lite5200.c +++ b/arch/powerpc/platforms/52xx/lite5200.c | |||
@@ -94,8 +94,8 @@ static void __init lite5200_setup_arch(void) | |||
94 | 94 | ||
95 | np = of_find_node_by_type(NULL, "cpu"); | 95 | np = of_find_node_by_type(NULL, "cpu"); |
96 | if (np) { | 96 | if (np) { |
97 | unsigned int *fp = | 97 | const unsigned int *fp = |
98 | (int *)get_property(np, "clock-frequency", NULL); | 98 | of_get_property(np, "clock-frequency", NULL); |
99 | if (fp != 0) | 99 | if (fp != 0) |
100 | loops_per_jiffy = *fp / HZ; | 100 | loops_per_jiffy = *fp / HZ; |
101 | else | 101 | else |
@@ -132,7 +132,7 @@ void lite5200_show_cpuinfo(struct seq_file *m) | |||
132 | const char *model = NULL; | 132 | const char *model = NULL; |
133 | 133 | ||
134 | if (np) | 134 | if (np) |
135 | model = get_property(np, "model", NULL); | 135 | model = of_get_property(np, "model", NULL); |
136 | 136 | ||
137 | seq_printf(m, "vendor\t\t: Freescale Semiconductor\n"); | 137 | seq_printf(m, "vendor\t\t: Freescale Semiconductor\n"); |
138 | seq_printf(m, "machine\t\t: %s\n", model ? model : "unknown"); | 138 | seq_printf(m, "machine\t\t: %s\n", model ? model : "unknown"); |
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_common.c b/arch/powerpc/platforms/52xx/mpc52xx_common.c index ed0cb694aea8..2dd415ff55a9 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_common.c +++ b/arch/powerpc/platforms/52xx/mpc52xx_common.c | |||
@@ -60,7 +60,7 @@ mpc52xx_find_ipb_freq(struct device_node *node) | |||
60 | 60 | ||
61 | of_node_get(node); | 61 | of_node_get(node); |
62 | while (node) { | 62 | while (node) { |
63 | p_ipb_freq = get_property(node, "bus-frequency", NULL); | 63 | p_ipb_freq = of_get_property(node, "bus-frequency", NULL); |
64 | if (p_ipb_freq) | 64 | if (p_ipb_freq) |
65 | break; | 65 | break; |
66 | 66 | ||
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pci.c b/arch/powerpc/platforms/52xx/mpc52xx_pci.c index faf161bdbc1c..34d34a26d305 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_pci.c +++ b/arch/powerpc/platforms/52xx/mpc52xx_pci.c | |||
@@ -370,7 +370,7 @@ mpc52xx_add_bridge(struct device_node *node) | |||
370 | return -EINVAL; | 370 | return -EINVAL; |
371 | } | 371 | } |
372 | 372 | ||
373 | bus_range = get_property(node, "bus-range", &len); | 373 | bus_range = of_get_property(node, "bus-range", &len); |
374 | if (bus_range == NULL || len < 2 * sizeof(int)) { | 374 | if (bus_range == NULL || len < 2 * sizeof(int)) { |
375 | printk(KERN_WARNING "Can't get %s bus-range, assume bus 0\n", | 375 | printk(KERN_WARNING "Can't get %s bus-range, assume bus 0\n", |
376 | node->full_name); | 376 | node->full_name); |
diff --git a/arch/powerpc/platforms/82xx/mpc82xx.c b/arch/powerpc/platforms/82xx/mpc82xx.c index 74e7892cdfcf..cc9900d2e5ee 100644 --- a/arch/powerpc/platforms/82xx/mpc82xx.c +++ b/arch/powerpc/platforms/82xx/mpc82xx.c | |||
@@ -55,17 +55,17 @@ | |||
55 | static int __init get_freq(char *name, unsigned long *val) | 55 | static int __init get_freq(char *name, unsigned long *val) |
56 | { | 56 | { |
57 | struct device_node *cpu; | 57 | struct device_node *cpu; |
58 | unsigned int *fp; | 58 | const unsigned int *fp; |
59 | int found = 0; | 59 | int found = 0; |
60 | 60 | ||
61 | /* The cpu node should have timebase and clock frequency properties */ | 61 | /* The cpu node should have timebase and clock frequency properties */ |
62 | cpu = of_find_node_by_type(NULL, "cpu"); | 62 | cpu = of_find_node_by_type(NULL, "cpu"); |
63 | 63 | ||
64 | if (cpu) { | 64 | if (cpu) { |
65 | fp = (unsigned int *)get_property(cpu, name, NULL); | 65 | fp = of_get_property(cpu, name, NULL); |
66 | if (fp) { | 66 | if (fp) { |
67 | found = 1; | 67 | found = 1; |
68 | *val = *fp++; | 68 | *val = *fp; |
69 | } | 69 | } |
70 | 70 | ||
71 | of_node_put(cpu); | 71 | of_node_put(cpu); |
diff --git a/arch/powerpc/platforms/82xx/mpc82xx_ads.c b/arch/powerpc/platforms/82xx/mpc82xx_ads.c index 7334c1a15b90..47cb09f08052 100644 --- a/arch/powerpc/platforms/82xx/mpc82xx_ads.c +++ b/arch/powerpc/platforms/82xx/mpc82xx_ads.c | |||
@@ -456,7 +456,7 @@ void m82xx_pci_init_irq(void) | |||
456 | iounmap(immap); | 456 | iounmap(immap); |
457 | return; | 457 | return; |
458 | } | 458 | } |
459 | irq_map = get_property(np, "interrupt-map", &size); | 459 | irq_map = of_get_property(np, "interrupt-map", &size); |
460 | if ((!irq_map) || (size <= 7)) { | 460 | if ((!irq_map) || (size <= 7)) { |
461 | printk(KERN_INFO "No interrupt-map property of pci node\n"); | 461 | printk(KERN_INFO "No interrupt-map property of pci node\n"); |
462 | iounmap(immap); | 462 | iounmap(immap); |
@@ -481,7 +481,7 @@ void m82xx_pci_init_irq(void) | |||
481 | } | 481 | } |
482 | pci_pic_node = of_node_get(np); | 482 | pci_pic_node = of_node_get(np); |
483 | /* PCI interrupt controller registers: status and mask */ | 483 | /* PCI interrupt controller registers: status and mask */ |
484 | regs = get_property(np, "reg", &size); | 484 | regs = of_get_property(np, "reg", &size); |
485 | if ((!regs) || (size <= 2)) { | 485 | if ((!regs) || (size <= 2)) { |
486 | printk(KERN_INFO "No reg property in pci pic node\n"); | 486 | printk(KERN_INFO "No reg property in pci pic node\n"); |
487 | iounmap(immap); | 487 | iounmap(immap); |
@@ -521,20 +521,20 @@ void __init add_bridge(struct device_node *np) | |||
521 | struct pci_controller *hose; | 521 | struct pci_controller *hose; |
522 | struct resource r; | 522 | struct resource r; |
523 | const int *bus_range; | 523 | const int *bus_range; |
524 | const void *ptr; | 524 | const uint *ptr; |
525 | 525 | ||
526 | memset(&r, 0, sizeof(r)); | 526 | memset(&r, 0, sizeof(r)); |
527 | if (of_address_to_resource(np, 0, &r)) { | 527 | if (of_address_to_resource(np, 0, &r)) { |
528 | printk(KERN_INFO "No PCI reg property in device tree\n"); | 528 | printk(KERN_INFO "No PCI reg property in device tree\n"); |
529 | return; | 529 | return; |
530 | } | 530 | } |
531 | if (!(ptr = get_property(np, "clock-frequency", NULL))) { | 531 | if (!(ptr = of_get_property(np, "clock-frequency", NULL))) { |
532 | printk(KERN_INFO "No clock-frequency property in PCI node"); | 532 | printk(KERN_INFO "No clock-frequency property in PCI node"); |
533 | return; | 533 | return; |
534 | } | 534 | } |
535 | pci_clk_frq = *(uint *) ptr; | 535 | pci_clk_frq = *ptr; |
536 | of_node_put(np); | 536 | of_node_put(np); |
537 | bus_range = get_property(np, "bus-range", &len); | 537 | bus_range = of_get_property(np, "bus-range", &len); |
538 | if (bus_range == NULL || len < 2 * sizeof(int)) { | 538 | if (bus_range == NULL || len < 2 * sizeof(int)) { |
539 | printk(KERN_WARNING "Can't get bus-range for %s, assume" | 539 | printk(KERN_WARNING "Can't get bus-range for %s, assume" |
540 | " bus 0\n", np->full_name); | 540 | " bus 0\n", np->full_name); |
diff --git a/arch/powerpc/platforms/83xx/pci.c b/arch/powerpc/platforms/83xx/pci.c index 9c3650555144..774457d09e94 100644 --- a/arch/powerpc/platforms/83xx/pci.c +++ b/arch/powerpc/platforms/83xx/pci.c | |||
@@ -60,7 +60,7 @@ int __init add_bridge(struct device_node *dev) | |||
60 | has_address = (of_address_to_resource(dev, 0, &rsrc) == 0); | 60 | has_address = (of_address_to_resource(dev, 0, &rsrc) == 0); |
61 | 61 | ||
62 | /* Get bus range if any */ | 62 | /* Get bus range if any */ |
63 | bus_range = get_property(dev, "bus-range", &len); | 63 | bus_range = of_get_property(dev, "bus-range", &len); |
64 | if (bus_range == NULL || len < 2 * sizeof(int)) { | 64 | if (bus_range == NULL || len < 2 * sizeof(int)) { |
65 | printk(KERN_WARNING "Can't get bus-range for %s, assume" | 65 | printk(KERN_WARNING "Can't get bus-range for %s, assume" |
66 | " bus 0\n", dev->full_name); | 66 | " bus 0\n", dev->full_name); |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c index 8ed034aeca5f..5d27621f0927 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c | |||
@@ -227,7 +227,7 @@ static void __init mpc85xx_ads_setup_arch(void) | |||
227 | if (cpu != 0) { | 227 | if (cpu != 0) { |
228 | const unsigned int *fp; | 228 | const unsigned int *fp; |
229 | 229 | ||
230 | fp = get_property(cpu, "clock-frequency", NULL); | 230 | fp = of_get_property(cpu, "clock-frequency", NULL); |
231 | if (fp != 0) | 231 | if (fp != 0) |
232 | loops_per_jiffy = *fp / HZ; | 232 | loops_per_jiffy = *fp / HZ; |
233 | else | 233 | else |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c index 4232686be441..7e71636f9098 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c | |||
@@ -237,7 +237,7 @@ static void __init mpc85xx_cds_setup_arch(void) | |||
237 | if (cpu != 0) { | 237 | if (cpu != 0) { |
238 | const unsigned int *fp; | 238 | const unsigned int *fp; |
239 | 239 | ||
240 | fp = get_property(cpu, "clock-frequency", NULL); | 240 | fp = of_get_property(cpu, "clock-frequency", NULL); |
241 | if (fp != 0) | 241 | if (fp != 0) |
242 | loops_per_jiffy = *fp / HZ; | 242 | loops_per_jiffy = *fp / HZ; |
243 | else | 243 | else |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c index 81144d2ae455..54db41689954 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c | |||
@@ -80,7 +80,7 @@ static void __init mpc85xx_mds_setup_arch(void) | |||
80 | np = of_find_node_by_type(NULL, "cpu"); | 80 | np = of_find_node_by_type(NULL, "cpu"); |
81 | if (np != NULL) { | 81 | if (np != NULL) { |
82 | const unsigned int *fp = | 82 | const unsigned int *fp = |
83 | get_property(np, "clock-frequency", NULL); | 83 | of_get_property(np, "clock-frequency", NULL); |
84 | if (fp != NULL) | 84 | if (fp != NULL) |
85 | loops_per_jiffy = *fp / HZ; | 85 | loops_per_jiffy = *fp / HZ; |
86 | else | 86 | else |
diff --git a/arch/powerpc/platforms/85xx/pci.c b/arch/powerpc/platforms/85xx/pci.c index 05930eeb6e7f..48f17e23d771 100644 --- a/arch/powerpc/platforms/85xx/pci.c +++ b/arch/powerpc/platforms/85xx/pci.c | |||
@@ -51,7 +51,7 @@ int __init add_bridge(struct device_node *dev) | |||
51 | has_address = (of_address_to_resource(dev, 0, &rsrc) == 0); | 51 | has_address = (of_address_to_resource(dev, 0, &rsrc) == 0); |
52 | 52 | ||
53 | /* Get bus range if any */ | 53 | /* Get bus range if any */ |
54 | bus_range = get_property(dev, "bus-range", &len); | 54 | bus_range = of_get_property(dev, "bus-range", &len); |
55 | if (bus_range == NULL || len < 2 * sizeof(int)) { | 55 | if (bus_range == NULL || len < 2 * sizeof(int)) { |
56 | printk(KERN_WARNING "Can't get bus-range for %s, assume" | 56 | printk(KERN_WARNING "Can't get bus-range for %s, assume" |
57 | " bus 0\n", dev->full_name); | 57 | " bus 0\n", dev->full_name); |
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c index f42f801cf84e..3d3d98f5bd4a 100644 --- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c | |||
@@ -349,7 +349,7 @@ mpc86xx_hpcn_setup_arch(void) | |||
349 | if (np != 0) { | 349 | if (np != 0) { |
350 | const unsigned int *fp; | 350 | const unsigned int *fp; |
351 | 351 | ||
352 | fp = get_property(np, "clock-frequency", NULL); | 352 | fp = of_get_property(np, "clock-frequency", NULL); |
353 | if (fp != 0) | 353 | if (fp != 0) |
354 | loops_per_jiffy = *fp / HZ; | 354 | loops_per_jiffy = *fp / HZ; |
355 | else | 355 | else |
@@ -384,7 +384,7 @@ mpc86xx_hpcn_show_cpuinfo(struct seq_file *m) | |||
384 | 384 | ||
385 | root = of_find_node_by_path("/"); | 385 | root = of_find_node_by_path("/"); |
386 | if (root) | 386 | if (root) |
387 | model = get_property(root, "model", NULL); | 387 | model = of_get_property(root, "model", NULL); |
388 | seq_printf(m, "Machine\t\t: %s\n", model); | 388 | seq_printf(m, "Machine\t\t: %s\n", model); |
389 | of_node_put(root); | 389 | of_node_put(root); |
390 | 390 | ||
diff --git a/arch/powerpc/platforms/86xx/pci.c b/arch/powerpc/platforms/86xx/pci.c index ba86c48f446b..8235c562661f 100644 --- a/arch/powerpc/platforms/86xx/pci.c +++ b/arch/powerpc/platforms/86xx/pci.c | |||
@@ -163,7 +163,7 @@ int __init add_bridge(struct device_node *dev) | |||
163 | has_address = (of_address_to_resource(dev, 0, &rsrc) == 0); | 163 | has_address = (of_address_to_resource(dev, 0, &rsrc) == 0); |
164 | 164 | ||
165 | /* Get bus range if any */ | 165 | /* Get bus range if any */ |
166 | bus_range = get_property(dev, "bus-range", &len); | 166 | bus_range = of_get_property(dev, "bus-range", &len); |
167 | if (bus_range == NULL || len < 2 * sizeof(int)) | 167 | if (bus_range == NULL || len < 2 * sizeof(int)) |
168 | printk(KERN_WARNING "Can't get bus-range for %s, assume" | 168 | printk(KERN_WARNING "Can't get bus-range for %s, assume" |
169 | " bus 0\n", dev->full_name); | 169 | " bus 0\n", dev->full_name); |
diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c b/arch/powerpc/platforms/8xx/m8xx_setup.c index 9ed7125f0150..0901dbada350 100644 --- a/arch/powerpc/platforms/8xx/m8xx_setup.c +++ b/arch/powerpc/platforms/8xx/m8xx_setup.c | |||
@@ -85,17 +85,17 @@ init_internal_rtc(void) | |||
85 | static int __init get_freq(char *name, unsigned long *val) | 85 | static int __init get_freq(char *name, unsigned long *val) |
86 | { | 86 | { |
87 | struct device_node *cpu; | 87 | struct device_node *cpu; |
88 | unsigned int *fp; | 88 | const unsigned int *fp; |
89 | int found = 0; | 89 | int found = 0; |
90 | 90 | ||
91 | /* The cpu node should have timebase and clock frequency properties */ | 91 | /* The cpu node should have timebase and clock frequency properties */ |
92 | cpu = of_find_node_by_type(NULL, "cpu"); | 92 | cpu = of_find_node_by_type(NULL, "cpu"); |
93 | 93 | ||
94 | if (cpu) { | 94 | if (cpu) { |
95 | fp = (unsigned int *)get_property(cpu, name, NULL); | 95 | fp = of_get_property(cpu, name, NULL); |
96 | if (fp) { | 96 | if (fp) { |
97 | found = 1; | 97 | found = 1; |
98 | *val = *fp++; | 98 | *val = *fp; |
99 | } | 99 | } |
100 | 100 | ||
101 | of_node_put(cpu); | 101 | of_node_put(cpu); |
@@ -262,7 +262,7 @@ void mpc8xx_show_cpuinfo(struct seq_file *m) | |||
262 | 262 | ||
263 | root = of_find_node_by_path("/"); | 263 | root = of_find_node_by_path("/"); |
264 | if (root) | 264 | if (root) |
265 | model = get_property(root, "model", NULL); | 265 | model = of_get_property(root, "model", NULL); |
266 | seq_printf(m, "Machine\t\t: %s\n", model); | 266 | seq_printf(m, "Machine\t\t: %s\n", model); |
267 | of_node_put(root); | 267 | of_node_put(root); |
268 | 268 | ||
diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c b/arch/powerpc/platforms/8xx/mpc86xads_setup.c index ef52ce701b0e..a35315af5c53 100644 --- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c | |||
@@ -247,7 +247,7 @@ void init_smc_ioports(struct fs_uart_platform_info *data) | |||
247 | } | 247 | } |
248 | } | 248 | } |
249 | 249 | ||
250 | int platform_device_skip(char *model, int id) | 250 | int platform_device_skip(const char *model, int id) |
251 | { | 251 | { |
252 | return 0; | 252 | return 0; |
253 | } | 253 | } |
@@ -260,7 +260,7 @@ static void __init mpc86xads_setup_arch(void) | |||
260 | if (cpu != 0) { | 260 | if (cpu != 0) { |
261 | const unsigned int *fp; | 261 | const unsigned int *fp; |
262 | 262 | ||
263 | fp = get_property(cpu, "clock-frequency", NULL); | 263 | fp = of_get_property(cpu, "clock-frequency", NULL); |
264 | if (fp != 0) | 264 | if (fp != 0) |
265 | loops_per_jiffy = *fp / HZ; | 265 | loops_per_jiffy = *fp / HZ; |
266 | else | 266 | else |
diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c index c5fefdf66c0a..a57b57785acd 100644 --- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c | |||
@@ -322,7 +322,7 @@ void init_smc_ioports(struct fs_uart_platform_info *data) | |||
322 | } | 322 | } |
323 | } | 323 | } |
324 | 324 | ||
325 | int platform_device_skip(char *model, int id) | 325 | int platform_device_skip(const char *model, int id) |
326 | { | 326 | { |
327 | #ifdef CONFIG_MPC8xx_SECOND_ETH_SCC3 | 327 | #ifdef CONFIG_MPC8xx_SECOND_ETH_SCC3 |
328 | const char *dev = "FEC"; | 328 | const char *dev = "FEC"; |
@@ -346,7 +346,7 @@ static void __init mpc885ads_setup_arch(void) | |||
346 | if (cpu != 0) { | 346 | if (cpu != 0) { |
347 | const unsigned int *fp; | 347 | const unsigned int *fp; |
348 | 348 | ||
349 | fp = get_property(cpu, "clock-frequency", NULL); | 349 | fp = of_get_property(cpu, "clock-frequency", NULL); |
350 | if (fp != 0) | 350 | if (fp != 0) |
351 | loops_per_jiffy = *fp / HZ; | 351 | loops_per_jiffy = *fp / HZ; |
352 | else | 352 | else |
diff --git a/arch/powerpc/platforms/cell/cbe_regs.c b/arch/powerpc/platforms/cell/cbe_regs.c index 9a0ee62691d5..7c94af4ac439 100644 --- a/arch/powerpc/platforms/cell/cbe_regs.c +++ b/arch/powerpc/platforms/cell/cbe_regs.c | |||
@@ -174,16 +174,15 @@ void __init cbe_regs_init(void) | |||
174 | if (cbe_thread_map[i].cpu_node == cpu) | 174 | if (cbe_thread_map[i].cpu_node == cpu) |
175 | cbe_thread_map[i].regs = map; | 175 | cbe_thread_map[i].regs = map; |
176 | 176 | ||
177 | prop = get_property(cpu, "pervasive", NULL); | 177 | prop = of_get_property(cpu, "pervasive", NULL); |
178 | if (prop != NULL) | 178 | if (prop != NULL) |
179 | map->pmd_regs = ioremap(prop->address, prop->len); | 179 | map->pmd_regs = ioremap(prop->address, prop->len); |
180 | 180 | ||
181 | prop = get_property(cpu, "iic", NULL); | 181 | prop = of_get_property(cpu, "iic", NULL); |
182 | if (prop != NULL) | 182 | if (prop != NULL) |
183 | map->iic_regs = ioremap(prop->address, prop->len); | 183 | map->iic_regs = ioremap(prop->address, prop->len); |
184 | 184 | ||
185 | prop = (struct address_prop *)get_property(cpu, "mic-tm", | 185 | prop = of_get_property(cpu, "mic-tm", NULL); |
186 | NULL); | ||
187 | if (prop != NULL) | 186 | if (prop != NULL) |
188 | map->mic_tm_regs = ioremap(prop->address, prop->len); | 187 | map->mic_tm_regs = ioremap(prop->address, prop->len); |
189 | } | 188 | } |
diff --git a/arch/powerpc/platforms/cell/cbe_thermal.c b/arch/powerpc/platforms/cell/cbe_thermal.c index 70e0d968d30f..e8bcd2a767ce 100644 --- a/arch/powerpc/platforms/cell/cbe_thermal.c +++ b/arch/powerpc/platforms/cell/cbe_thermal.c | |||
@@ -43,14 +43,14 @@ static struct cbe_pmd_regs __iomem *get_pmd_regs(struct sys_device *sysdev) | |||
43 | /* returns the value for a given spu in a given register */ | 43 | /* returns the value for a given spu in a given register */ |
44 | static u8 spu_read_register_value(struct sys_device *sysdev, union spe_reg __iomem *reg) | 44 | static u8 spu_read_register_value(struct sys_device *sysdev, union spe_reg __iomem *reg) |
45 | { | 45 | { |
46 | unsigned int *id; | 46 | const unsigned int *id; |
47 | union spe_reg value; | 47 | union spe_reg value; |
48 | struct spu *spu; | 48 | struct spu *spu; |
49 | 49 | ||
50 | /* getting the id from the reg attribute will not work on future device-tree layouts | 50 | /* getting the id from the reg attribute will not work on future device-tree layouts |
51 | * in future we should store the id to the spu struct and use it here */ | 51 | * in future we should store the id to the spu struct and use it here */ |
52 | spu = container_of(sysdev, struct spu, sysdev); | 52 | spu = container_of(sysdev, struct spu, sysdev); |
53 | id = (unsigned int *)get_property(spu_devnode(spu), "reg", NULL); | 53 | id = of_get_property(spu_devnode(spu), "reg", NULL); |
54 | value.val = in_be64(®->val); | 54 | value.val = in_be64(®->val); |
55 | 55 | ||
56 | return value.spe[*id]; | 56 | return value.spe[*id]; |
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c index 6666d037eb44..4fc4e92775d0 100644 --- a/arch/powerpc/platforms/cell/interrupt.c +++ b/arch/powerpc/platforms/cell/interrupt.c | |||
@@ -261,7 +261,7 @@ static int iic_host_xlate(struct irq_host *h, struct device_node *ct, | |||
261 | return -ENODEV; | 261 | return -ENODEV; |
262 | if (intsize != 1) | 262 | if (intsize != 1) |
263 | return -ENODEV; | 263 | return -ENODEV; |
264 | val = get_property(ct, "#interrupt-cells", NULL); | 264 | val = of_get_property(ct, "#interrupt-cells", NULL); |
265 | if (val == NULL || *val != 1) | 265 | if (val == NULL || *val != 1) |
266 | return -ENODEV; | 266 | return -ENODEV; |
267 | 267 | ||
@@ -327,7 +327,7 @@ static int __init setup_iic(void) | |||
327 | if (!device_is_compatible(dn, | 327 | if (!device_is_compatible(dn, |
328 | "IBM,CBEA-Internal-Interrupt-Controller")) | 328 | "IBM,CBEA-Internal-Interrupt-Controller")) |
329 | continue; | 329 | continue; |
330 | np = get_property(dn, "ibm,interrupt-server-ranges", NULL); | 330 | np = of_get_property(dn, "ibm,interrupt-server-ranges", NULL); |
331 | if (np == NULL) { | 331 | if (np == NULL) { |
332 | printk(KERN_WARNING "IIC: CPU association not found\n"); | 332 | printk(KERN_WARNING "IIC: CPU association not found\n"); |
333 | of_node_put(dn); | 333 | of_node_put(dn); |
diff --git a/arch/powerpc/platforms/cell/io-workarounds.c b/arch/powerpc/platforms/cell/io-workarounds.c index 7c73128305ec..d68d920eb2c4 100644 --- a/arch/powerpc/platforms/cell/io-workarounds.c +++ b/arch/powerpc/platforms/cell/io-workarounds.c | |||
@@ -318,7 +318,7 @@ static int __init spider_pci_workaround_init(void) | |||
318 | */ | 318 | */ |
319 | list_for_each_entry(phb, &hose_list, list_node) { | 319 | list_for_each_entry(phb, &hose_list, list_node) { |
320 | struct device_node *np = phb->arch_data; | 320 | struct device_node *np = phb->arch_data; |
321 | const char *model = get_property(np, "model", NULL); | 321 | const char *model = of_get_property(np, "model", NULL); |
322 | 322 | ||
323 | /* If no model property or name isn't exactly "pci", skip */ | 323 | /* If no model property or name isn't exactly "pci", skip */ |
324 | if (model == NULL || strcmp(np->name, "pci")) | 324 | if (model == NULL || strcmp(np->name, "pci")) |
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c index 7c953cc022f6..760caa76841a 100644 --- a/arch/powerpc/platforms/cell/iommu.c +++ b/arch/powerpc/platforms/cell/iommu.c | |||
@@ -291,9 +291,9 @@ static int cell_iommu_find_ioc(int nid, unsigned long *base) | |||
291 | const unsigned int *nidp; | 291 | const unsigned int *nidp; |
292 | const unsigned long *tmp; | 292 | const unsigned long *tmp; |
293 | 293 | ||
294 | nidp = get_property(np, "node-id", NULL); | 294 | nidp = of_get_property(np, "node-id", NULL); |
295 | if (nidp && *nidp == nid) { | 295 | if (nidp && *nidp == nid) { |
296 | tmp = get_property(np, "ioc-translation", NULL); | 296 | tmp = of_get_property(np, "ioc-translation", NULL); |
297 | if (tmp) { | 297 | if (tmp) { |
298 | *base = *tmp; | 298 | *base = *tmp; |
299 | of_node_put(np); | 299 | of_node_put(np); |
@@ -430,7 +430,7 @@ cell_iommu_setup_window(struct cbe_iommu *iommu, struct device_node *np, | |||
430 | struct iommu_window *window; | 430 | struct iommu_window *window; |
431 | const unsigned int *ioid; | 431 | const unsigned int *ioid; |
432 | 432 | ||
433 | ioid = get_property(np, "ioid", NULL); | 433 | ioid = of_get_property(np, "ioid", NULL); |
434 | if (ioid == NULL) | 434 | if (ioid == NULL) |
435 | printk(KERN_WARNING "iommu: missing ioid for %s using 0\n", | 435 | printk(KERN_WARNING "iommu: missing ioid for %s using 0\n", |
436 | np->full_name); | 436 | np->full_name); |
@@ -549,7 +549,7 @@ static int __init cell_iommu_get_window(struct device_node *np, | |||
549 | unsigned long index; | 549 | unsigned long index; |
550 | 550 | ||
551 | /* Use ibm,dma-window if available, else, hard code ! */ | 551 | /* Use ibm,dma-window if available, else, hard code ! */ |
552 | dma_window = get_property(np, "ibm,dma-window", NULL); | 552 | dma_window = of_get_property(np, "ibm,dma-window", NULL); |
553 | if (dma_window == NULL) { | 553 | if (dma_window == NULL) { |
554 | *base = 0; | 554 | *base = 0; |
555 | *size = 0x80000000u; | 555 | *size = 0x80000000u; |
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c index 36989c2eee66..5c5fa34e59ee 100644 --- a/arch/powerpc/platforms/cell/setup.c +++ b/arch/powerpc/platforms/cell/setup.c | |||
@@ -71,7 +71,7 @@ static void cell_show_cpuinfo(struct seq_file *m) | |||
71 | 71 | ||
72 | root = of_find_node_by_path("/"); | 72 | root = of_find_node_by_path("/"); |
73 | if (root) | 73 | if (root) |
74 | model = get_property(root, "model", NULL); | 74 | model = of_get_property(root, "model", NULL); |
75 | seq_printf(m, "machine\t\t: CHRP %s\n", model); | 75 | seq_printf(m, "machine\t\t: CHRP %s\n", model); |
76 | of_node_put(root); | 76 | of_node_put(root); |
77 | } | 77 | } |
diff --git a/arch/powerpc/platforms/cell/spider-pic.c b/arch/powerpc/platforms/cell/spider-pic.c index 21a9ebd4978e..fb1f15797bbb 100644 --- a/arch/powerpc/platforms/cell/spider-pic.c +++ b/arch/powerpc/platforms/cell/spider-pic.c | |||
@@ -254,25 +254,25 @@ static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic) | |||
254 | } | 254 | } |
255 | 255 | ||
256 | /* Now do the horrible hacks */ | 256 | /* Now do the horrible hacks */ |
257 | tmp = get_property(pic->of_node, "#interrupt-cells", NULL); | 257 | tmp = of_get_property(pic->of_node, "#interrupt-cells", NULL); |
258 | if (tmp == NULL) | 258 | if (tmp == NULL) |
259 | return NO_IRQ; | 259 | return NO_IRQ; |
260 | intsize = *tmp; | 260 | intsize = *tmp; |
261 | imap = get_property(pic->of_node, "interrupt-map", &imaplen); | 261 | imap = of_get_property(pic->of_node, "interrupt-map", &imaplen); |
262 | if (imap == NULL || imaplen < (intsize + 1)) | 262 | if (imap == NULL || imaplen < (intsize + 1)) |
263 | return NO_IRQ; | 263 | return NO_IRQ; |
264 | iic = of_find_node_by_phandle(imap[intsize]); | 264 | iic = of_find_node_by_phandle(imap[intsize]); |
265 | if (iic == NULL) | 265 | if (iic == NULL) |
266 | return NO_IRQ; | 266 | return NO_IRQ; |
267 | imap += intsize + 1; | 267 | imap += intsize + 1; |
268 | tmp = get_property(iic, "#interrupt-cells", NULL); | 268 | tmp = of_get_property(iic, "#interrupt-cells", NULL); |
269 | if (tmp == NULL) | 269 | if (tmp == NULL) |
270 | return NO_IRQ; | 270 | return NO_IRQ; |
271 | intsize = *tmp; | 271 | intsize = *tmp; |
272 | /* Assume unit is last entry of interrupt specifier */ | 272 | /* Assume unit is last entry of interrupt specifier */ |
273 | unit = imap[intsize - 1]; | 273 | unit = imap[intsize - 1]; |
274 | /* Ok, we have a unit, now let's try to get the node */ | 274 | /* Ok, we have a unit, now let's try to get the node */ |
275 | tmp = get_property(iic, "ibm,interrupt-server-ranges", NULL); | 275 | tmp = of_get_property(iic, "ibm,interrupt-server-ranges", NULL); |
276 | if (tmp == NULL) { | 276 | if (tmp == NULL) { |
277 | of_node_put(iic); | 277 | of_node_put(iic); |
278 | return NO_IRQ; | 278 | return NO_IRQ; |
diff --git a/arch/powerpc/platforms/cell/spu_manage.c b/arch/powerpc/platforms/cell/spu_manage.c index e34599f53d28..1d4562ae463d 100644 --- a/arch/powerpc/platforms/cell/spu_manage.c +++ b/arch/powerpc/platforms/cell/spu_manage.c | |||
@@ -48,11 +48,11 @@ static u64 __init find_spu_unit_number(struct device_node *spe) | |||
48 | { | 48 | { |
49 | const unsigned int *prop; | 49 | const unsigned int *prop; |
50 | int proplen; | 50 | int proplen; |
51 | prop = get_property(spe, "unit-id", &proplen); | 51 | prop = of_get_property(spe, "unit-id", &proplen); |
52 | if (proplen == 4) | 52 | if (proplen == 4) |
53 | return (u64)*prop; | 53 | return (u64)*prop; |
54 | 54 | ||
55 | prop = get_property(spe, "reg", &proplen); | 55 | prop = of_get_property(spe, "reg", &proplen); |
56 | if (proplen == 4) | 56 | if (proplen == 4) |
57 | return (u64)*prop; | 57 | return (u64)*prop; |
58 | 58 | ||
@@ -76,12 +76,12 @@ static int __init spu_map_interrupts_old(struct spu *spu, | |||
76 | int nid; | 76 | int nid; |
77 | 77 | ||
78 | /* Get the interrupt source unit from the device-tree */ | 78 | /* Get the interrupt source unit from the device-tree */ |
79 | tmp = get_property(np, "isrc", NULL); | 79 | tmp = of_get_property(np, "isrc", NULL); |
80 | if (!tmp) | 80 | if (!tmp) |
81 | return -ENODEV; | 81 | return -ENODEV; |
82 | isrc = tmp[0]; | 82 | isrc = tmp[0]; |
83 | 83 | ||
84 | tmp = get_property(np->parent->parent, "node-id", NULL); | 84 | tmp = of_get_property(np->parent->parent, "node-id", NULL); |
85 | if (!tmp) { | 85 | if (!tmp) { |
86 | printk(KERN_WARNING "%s: can't find node-id\n", __FUNCTION__); | 86 | printk(KERN_WARNING "%s: can't find node-id\n", __FUNCTION__); |
87 | nid = spu->node; | 87 | nid = spu->node; |
@@ -110,7 +110,7 @@ static void __iomem * __init spu_map_prop_old(struct spu *spu, | |||
110 | } __attribute__((packed)) *prop; | 110 | } __attribute__((packed)) *prop; |
111 | int proplen; | 111 | int proplen; |
112 | 112 | ||
113 | prop = get_property(n, name, &proplen); | 113 | prop = of_get_property(n, name, &proplen); |
114 | if (prop == NULL || proplen != sizeof (struct address_prop)) | 114 | if (prop == NULL || proplen != sizeof (struct address_prop)) |
115 | return NULL; | 115 | return NULL; |
116 | 116 | ||
@@ -124,11 +124,11 @@ static int __init spu_map_device_old(struct spu *spu) | |||
124 | int ret; | 124 | int ret; |
125 | 125 | ||
126 | ret = -ENODEV; | 126 | ret = -ENODEV; |
127 | spu->name = get_property(node, "name", NULL); | 127 | spu->name = of_get_property(node, "name", NULL); |
128 | if (!spu->name) | 128 | if (!spu->name) |
129 | goto out; | 129 | goto out; |
130 | 130 | ||
131 | prop = get_property(node, "local-store", NULL); | 131 | prop = of_get_property(node, "local-store", NULL); |
132 | if (!prop) | 132 | if (!prop) |
133 | goto out; | 133 | goto out; |
134 | spu->local_store_phys = *(unsigned long *)prop; | 134 | spu->local_store_phys = *(unsigned long *)prop; |
@@ -139,7 +139,7 @@ static int __init spu_map_device_old(struct spu *spu) | |||
139 | if (!spu->local_store) | 139 | if (!spu->local_store) |
140 | goto out; | 140 | goto out; |
141 | 141 | ||
142 | prop = get_property(node, "problem", NULL); | 142 | prop = of_get_property(node, "problem", NULL); |
143 | if (!prop) | 143 | if (!prop) |
144 | goto out_unmap; | 144 | goto out_unmap; |
145 | spu->problem_phys = *(unsigned long *)prop; | 145 | spu->problem_phys = *(unsigned long *)prop; |
@@ -226,7 +226,7 @@ static int __init spu_map_device(struct spu *spu) | |||
226 | struct device_node *np = spu->devnode; | 226 | struct device_node *np = spu->devnode; |
227 | int ret = -ENODEV; | 227 | int ret = -ENODEV; |
228 | 228 | ||
229 | spu->name = get_property(np, "name", NULL); | 229 | spu->name = of_get_property(np, "name", NULL); |
230 | if (!spu->name) | 230 | if (!spu->name) |
231 | goto out; | 231 | goto out; |
232 | 232 | ||
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index 8079983ef94f..e3f4ee97c913 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c | |||
@@ -571,7 +571,7 @@ spufs_init_isolated_loader(void) | |||
571 | if (!dn) | 571 | if (!dn) |
572 | return; | 572 | return; |
573 | 573 | ||
574 | loader = get_property(dn, "loader", &size); | 574 | loader = of_get_property(dn, "loader", &size); |
575 | if (!loader) | 575 | if (!loader) |
576 | return; | 576 | return; |
577 | 577 | ||
diff --git a/arch/powerpc/platforms/celleb/iommu.c b/arch/powerpc/platforms/celleb/iommu.c index e94de6a24622..755d869d8553 100644 --- a/arch/powerpc/platforms/celleb/iommu.c +++ b/arch/powerpc/platforms/celleb/iommu.c | |||
@@ -37,7 +37,7 @@ static int __init find_dma_window(u64 *io_space_id, u64 *ioid, | |||
37 | const unsigned long *dma_window; | 37 | const unsigned long *dma_window; |
38 | 38 | ||
39 | for_each_node_by_type(dn, "ioif") { | 39 | for_each_node_by_type(dn, "ioif") { |
40 | dma_window = get_property(dn, "toshiba,dma-window", NULL); | 40 | dma_window = of_get_property(dn, "toshiba,dma-window", NULL); |
41 | if (dma_window) { | 41 | if (dma_window) { |
42 | *io_space_id = (dma_window[0] >> 32) & 0xffffffffUL; | 42 | *io_space_id = (dma_window[0] >> 32) & 0xffffffffUL; |
43 | *ioid = dma_window[0] & 0x7ffUL; | 43 | *ioid = dma_window[0] & 0x7ffUL; |
diff --git a/arch/powerpc/platforms/celleb/pci.c b/arch/powerpc/platforms/celleb/pci.c index 98de836dfed3..d1adf34cd5e8 100644 --- a/arch/powerpc/platforms/celleb/pci.c +++ b/arch/powerpc/platforms/celleb/pci.c | |||
@@ -309,13 +309,13 @@ static int __devinit celleb_setup_fake_pci_device(struct device_node *node, | |||
309 | goto error; | 309 | goto error; |
310 | } | 310 | } |
311 | 311 | ||
312 | name = get_property(node, "model", &rlen); | 312 | name = of_get_property(node, "model", &rlen); |
313 | if (!name) { | 313 | if (!name) { |
314 | printk(KERN_ERR "PCI: model property not found.\n"); | 314 | printk(KERN_ERR "PCI: model property not found.\n"); |
315 | goto error; | 315 | goto error; |
316 | } | 316 | } |
317 | 317 | ||
318 | wi4 = get_property(node, "reg", &rlen); | 318 | wi4 = of_get_property(node, "reg", &rlen); |
319 | if (wi4 == NULL) | 319 | if (wi4 == NULL) |
320 | goto error; | 320 | goto error; |
321 | 321 | ||
@@ -352,10 +352,10 @@ static int __devinit celleb_setup_fake_pci_device(struct device_node *node, | |||
352 | } | 352 | } |
353 | pr_debug("PCI: res assigned 0x%016lx\n", (unsigned long)*res); | 353 | pr_debug("PCI: res assigned 0x%016lx\n", (unsigned long)*res); |
354 | 354 | ||
355 | wi0 = get_property(node, "device-id", NULL); | 355 | wi0 = of_get_property(node, "device-id", NULL); |
356 | wi1 = get_property(node, "vendor-id", NULL); | 356 | wi1 = of_get_property(node, "vendor-id", NULL); |
357 | wi2 = get_property(node, "class-code", NULL); | 357 | wi2 = of_get_property(node, "class-code", NULL); |
358 | wi3 = get_property(node, "revision-id", NULL); | 358 | wi3 = of_get_property(node, "revision-id", NULL); |
359 | 359 | ||
360 | celleb_config_write_fake(*config, PCI_DEVICE_ID, 2, wi0[0] & 0xffff); | 360 | celleb_config_write_fake(*config, PCI_DEVICE_ID, 2, wi0[0] & 0xffff); |
361 | celleb_config_write_fake(*config, PCI_VENDOR_ID, 2, wi1[0] & 0xffff); | 361 | celleb_config_write_fake(*config, PCI_VENDOR_ID, 2, wi1[0] & 0xffff); |
@@ -376,7 +376,7 @@ static int __devinit celleb_setup_fake_pci_device(struct device_node *node, | |||
376 | 376 | ||
377 | celleb_setup_pci_base_addrs(hose, devno, fn, num_base_addr); | 377 | celleb_setup_pci_base_addrs(hose, devno, fn, num_base_addr); |
378 | 378 | ||
379 | li = get_property(node, "interrupts", &rlen); | 379 | li = of_get_property(node, "interrupts", &rlen); |
380 | val = li[0]; | 380 | val = li[0]; |
381 | celleb_config_write_fake(*config, PCI_INTERRUPT_PIN, 1, 1); | 381 | celleb_config_write_fake(*config, PCI_INTERRUPT_PIN, 1, 1); |
382 | celleb_config_write_fake(*config, PCI_INTERRUPT_LINE, 1, val); | 382 | celleb_config_write_fake(*config, PCI_INTERRUPT_LINE, 1, val); |
@@ -424,7 +424,7 @@ static int __devinit phb_set_bus_ranges(struct device_node *dev, | |||
424 | const int *bus_range; | 424 | const int *bus_range; |
425 | unsigned int len; | 425 | unsigned int len; |
426 | 426 | ||
427 | bus_range = get_property(dev, "bus-range", &len); | 427 | bus_range = of_get_property(dev, "bus-range", &len); |
428 | if (bus_range == NULL || len < 2 * sizeof(int)) | 428 | if (bus_range == NULL || len < 2 * sizeof(int)) |
429 | return 1; | 429 | return 1; |
430 | 430 | ||
@@ -451,7 +451,7 @@ int __devinit celleb_setup_phb(struct pci_controller *phb) | |||
451 | struct device_node *node; | 451 | struct device_node *node; |
452 | unsigned int rlen; | 452 | unsigned int rlen; |
453 | 453 | ||
454 | name = get_property(dev, "name", &rlen); | 454 | name = of_get_property(dev, "name", &rlen); |
455 | if (!name) | 455 | if (!name) |
456 | return 1; | 456 | return 1; |
457 | 457 | ||
diff --git a/arch/powerpc/platforms/celleb/setup.c b/arch/powerpc/platforms/celleb/setup.c index 5f4d0d933238..ab1db9dd1aa1 100644 --- a/arch/powerpc/platforms/celleb/setup.c +++ b/arch/powerpc/platforms/celleb/setup.c | |||
@@ -67,7 +67,7 @@ static void celleb_show_cpuinfo(struct seq_file *m) | |||
67 | 67 | ||
68 | root = of_find_node_by_path("/"); | 68 | root = of_find_node_by_path("/"); |
69 | if (root) | 69 | if (root) |
70 | model = get_property(root, "model", NULL); | 70 | model = of_get_property(root, "model", NULL); |
71 | /* using "CHRP" is to trick anaconda into installing FCx into Celleb */ | 71 | /* using "CHRP" is to trick anaconda into installing FCx into Celleb */ |
72 | seq_printf(m, "machine\t\t: %s %s\n", celleb_machine_type, model); | 72 | seq_printf(m, "machine\t\t: %s %s\n", celleb_machine_type, model); |
73 | of_node_put(root); | 73 | of_node_put(root); |
diff --git a/arch/powerpc/platforms/chrp/nvram.c b/arch/powerpc/platforms/chrp/nvram.c index 0dd4a64757d9..8efd4244701c 100644 --- a/arch/powerpc/platforms/chrp/nvram.c +++ b/arch/powerpc/platforms/chrp/nvram.c | |||
@@ -74,7 +74,7 @@ void __init chrp_nvram_init(void) | |||
74 | if (nvram == NULL) | 74 | if (nvram == NULL) |
75 | return; | 75 | return; |
76 | 76 | ||
77 | nbytes_p = get_property(nvram, "#bytes", &proplen); | 77 | nbytes_p = of_get_property(nvram, "#bytes", &proplen); |
78 | if (nbytes_p == NULL || proplen != sizeof(unsigned int)) | 78 | if (nbytes_p == NULL || proplen != sizeof(unsigned int)) |
79 | return; | 79 | return; |
80 | 80 | ||
diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c index e2f870800e58..b23e39796a0b 100644 --- a/arch/powerpc/platforms/chrp/pci.c +++ b/arch/powerpc/platforms/chrp/pci.c | |||
@@ -217,7 +217,7 @@ chrp_find_bridges(void) | |||
217 | * properties to adequately identify them, so we have to | 217 | * properties to adequately identify them, so we have to |
218 | * look at what sort of machine this is as well. | 218 | * look at what sort of machine this is as well. |
219 | */ | 219 | */ |
220 | machine = get_property(root, "model", NULL); | 220 | machine = of_get_property(root, "model", NULL); |
221 | if (machine != NULL) { | 221 | if (machine != NULL) { |
222 | is_longtrail = strncmp(machine, "IBM,LongTrail", 13) == 0; | 222 | is_longtrail = strncmp(machine, "IBM,LongTrail", 13) == 0; |
223 | is_mot = strncmp(machine, "MOT", 3) == 0; | 223 | is_mot = strncmp(machine, "MOT", 3) == 0; |
@@ -236,7 +236,7 @@ chrp_find_bridges(void) | |||
236 | dev->full_name); | 236 | dev->full_name); |
237 | continue; | 237 | continue; |
238 | } | 238 | } |
239 | bus_range = get_property(dev, "bus-range", &len); | 239 | bus_range = of_get_property(dev, "bus-range", &len); |
240 | if (bus_range == NULL || len < 2 * sizeof(int)) { | 240 | if (bus_range == NULL || len < 2 * sizeof(int)) { |
241 | printk(KERN_WARNING "Can't get bus-range for %s\n", | 241 | printk(KERN_WARNING "Can't get bus-range for %s\n", |
242 | dev->full_name); | 242 | dev->full_name); |
@@ -262,7 +262,7 @@ chrp_find_bridges(void) | |||
262 | hose->first_busno = bus_range[0]; | 262 | hose->first_busno = bus_range[0]; |
263 | hose->last_busno = bus_range[1]; | 263 | hose->last_busno = bus_range[1]; |
264 | 264 | ||
265 | model = get_property(dev, "model", NULL); | 265 | model = of_get_property(dev, "model", NULL); |
266 | if (model == NULL) | 266 | if (model == NULL) |
267 | model = "<none>"; | 267 | model = "<none>"; |
268 | if (device_is_compatible(dev, "IBM,python")) { | 268 | if (device_is_compatible(dev, "IBM,python")) { |
@@ -284,7 +284,8 @@ chrp_find_bridges(void) | |||
284 | r.start + 0x000f8000, | 284 | r.start + 0x000f8000, |
285 | r.start + 0x000f8010); | 285 | r.start + 0x000f8010); |
286 | if (index == 0) { | 286 | if (index == 0) { |
287 | dma = get_property(dev, "system-dma-base",&len); | 287 | dma = of_get_property(dev, "system-dma-base", |
288 | &len); | ||
288 | if (dma && len >= sizeof(*dma)) { | 289 | if (dma && len >= sizeof(*dma)) { |
289 | dma = (unsigned int *) | 290 | dma = (unsigned int *) |
290 | (((unsigned long)dma) + | 291 | (((unsigned long)dma) + |
@@ -302,7 +303,7 @@ chrp_find_bridges(void) | |||
302 | 303 | ||
303 | /* check the first bridge for a property that we can | 304 | /* check the first bridge for a property that we can |
304 | use to set pci_dram_offset */ | 305 | use to set pci_dram_offset */ |
305 | dma = get_property(dev, "ibm,dma-ranges", &len); | 306 | dma = of_get_property(dev, "ibm,dma-ranges", &len); |
306 | if (index == 0 && dma != NULL && len >= 6 * sizeof(*dma)) { | 307 | if (index == 0 && dma != NULL && len >= 6 * sizeof(*dma)) { |
307 | pci_dram_offset = dma[2] - dma[3]; | 308 | pci_dram_offset = dma[2] - dma[3]; |
308 | printk("pci_dram_offset = %lx\n", pci_dram_offset); | 309 | printk("pci_dram_offset = %lx\n", pci_dram_offset); |
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c index 044ad3f1e04a..05d1bc0c8918 100644 --- a/arch/powerpc/platforms/chrp/setup.c +++ b/arch/powerpc/platforms/chrp/setup.c | |||
@@ -112,7 +112,7 @@ void chrp_show_cpuinfo(struct seq_file *m) | |||
112 | 112 | ||
113 | root = find_path_device("/"); | 113 | root = find_path_device("/"); |
114 | if (root) | 114 | if (root) |
115 | model = get_property(root, "model", NULL); | 115 | model = of_get_property(root, "model", NULL); |
116 | seq_printf(m, "machine\t\t: CHRP %s\n", model); | 116 | seq_printf(m, "machine\t\t: CHRP %s\n", model); |
117 | 117 | ||
118 | /* longtrail (goldengate) stuff */ | 118 | /* longtrail (goldengate) stuff */ |
@@ -205,7 +205,8 @@ static void __init sio_init(void) | |||
205 | struct device_node *root; | 205 | struct device_node *root; |
206 | 206 | ||
207 | if ((root = find_path_device("/")) && | 207 | if ((root = find_path_device("/")) && |
208 | !strncmp(get_property(root, "model", NULL), "IBM,LongTrail", 13)) { | 208 | !strncmp(of_get_property(root, "model", NULL), |
209 | "IBM,LongTrail", 13)) { | ||
209 | /* logical device 0 (KBC/Keyboard) */ | 210 | /* logical device 0 (KBC/Keyboard) */ |
210 | sio_fixup_irq("keyboard", 0, 1, 2); | 211 | sio_fixup_irq("keyboard", 0, 1, 2); |
211 | /* select logical device 1 (KBC/Mouse) */ | 212 | /* select logical device 1 (KBC/Mouse) */ |
@@ -225,7 +226,7 @@ static void __init pegasos_set_l2cr(void) | |||
225 | /* Enable L2 cache if needed */ | 226 | /* Enable L2 cache if needed */ |
226 | np = find_type_devices("cpu"); | 227 | np = find_type_devices("cpu"); |
227 | if (np != NULL) { | 228 | if (np != NULL) { |
228 | const unsigned int *l2cr = get_property(np, "l2cr", NULL); | 229 | const unsigned int *l2cr = of_get_property(np, "l2cr", NULL); |
229 | if (l2cr == NULL) { | 230 | if (l2cr == NULL) { |
230 | printk ("Pegasos l2cr : no cpu l2cr property found\n"); | 231 | printk ("Pegasos l2cr : no cpu l2cr property found\n"); |
231 | return; | 232 | return; |
@@ -256,7 +257,7 @@ void __init chrp_setup_arch(void) | |||
256 | loops_per_jiffy = 50000000/HZ; | 257 | loops_per_jiffy = 50000000/HZ; |
257 | 258 | ||
258 | if (root) | 259 | if (root) |
259 | machine = get_property(root, "model", NULL); | 260 | machine = of_get_property(root, "model", NULL); |
260 | if (machine && strncmp(machine, "Pegasos", 7) == 0) { | 261 | if (machine && strncmp(machine, "Pegasos", 7) == 0) { |
261 | _chrp_type = _CHRP_Pegasos; | 262 | _chrp_type = _CHRP_Pegasos; |
262 | } else if (machine && strncmp(machine, "IBM", 3) == 0) { | 263 | } else if (machine && strncmp(machine, "IBM", 3) == 0) { |
@@ -360,7 +361,7 @@ static void __init chrp_find_openpic(void) | |||
360 | return; | 361 | return; |
361 | root = of_find_node_by_path("/"); | 362 | root = of_find_node_by_path("/"); |
362 | if (root) { | 363 | if (root) { |
363 | opprop = get_property(root, "platform-open-pic", &oplen); | 364 | opprop = of_get_property(root, "platform-open-pic", &oplen); |
364 | na = of_n_addr_cells(root); | 365 | na = of_n_addr_cells(root); |
365 | } | 366 | } |
366 | if (opprop && oplen >= na * sizeof(unsigned int)) { | 367 | if (opprop && oplen >= na * sizeof(unsigned int)) { |
@@ -377,7 +378,7 @@ static void __init chrp_find_openpic(void) | |||
377 | 378 | ||
378 | printk(KERN_INFO "OpenPIC at %lx\n", opaddr); | 379 | printk(KERN_INFO "OpenPIC at %lx\n", opaddr); |
379 | 380 | ||
380 | iranges = get_property(np, "interrupt-ranges", &len); | 381 | iranges = of_get_property(np, "interrupt-ranges", &len); |
381 | if (iranges == NULL) | 382 | if (iranges == NULL) |
382 | len = 0; /* non-distributed mpic */ | 383 | len = 0; /* non-distributed mpic */ |
383 | else | 384 | else |
@@ -463,7 +464,7 @@ static void __init chrp_find_8259(void) | |||
463 | * from anyway | 464 | * from anyway |
464 | */ | 465 | */ |
465 | for (np = find_devices("pci"); np != NULL; np = np->next) { | 466 | for (np = find_devices("pci"); np != NULL; np = np->next) { |
466 | const unsigned int *addrp = get_property(np, | 467 | const unsigned int *addrp = of_get_property(np, |
467 | "8259-interrupt-acknowledge", NULL); | 468 | "8259-interrupt-acknowledge", NULL); |
468 | 469 | ||
469 | if (addrp == NULL) | 470 | if (addrp == NULL) |
@@ -543,7 +544,7 @@ chrp_init2(void) | |||
543 | */ | 544 | */ |
544 | device = find_devices("rtas"); | 545 | device = find_devices("rtas"); |
545 | if (device) | 546 | if (device) |
546 | p = get_property(device, "rtas-event-scan-rate", NULL); | 547 | p = of_get_property(device, "rtas-event-scan-rate", NULL); |
547 | if (p && *p) { | 548 | if (p && *p) { |
548 | /* | 549 | /* |
549 | * Arrange to call chrp_event_scan at least *p times | 550 | * Arrange to call chrp_event_scan at least *p times |
diff --git a/arch/powerpc/platforms/embedded6xx/linkstation.c b/arch/powerpc/platforms/embedded6xx/linkstation.c index 3f6c4114f908..b412f006a9c5 100644 --- a/arch/powerpc/platforms/embedded6xx/linkstation.c +++ b/arch/powerpc/platforms/embedded6xx/linkstation.c | |||
@@ -58,11 +58,11 @@ static int __init add_bridge(struct device_node *dev) | |||
58 | { | 58 | { |
59 | int len; | 59 | int len; |
60 | struct pci_controller *hose; | 60 | struct pci_controller *hose; |
61 | int *bus_range; | 61 | const int *bus_range; |
62 | 62 | ||
63 | printk("Adding PCI host bridge %s\n", dev->full_name); | 63 | printk("Adding PCI host bridge %s\n", dev->full_name); |
64 | 64 | ||
65 | bus_range = (int *) get_property(dev, "bus-range", &len); | 65 | bus_range = of_get_property(dev, "bus-range", &len); |
66 | if (bus_range == NULL || len < 2 * sizeof(int)) | 66 | if (bus_range == NULL || len < 2 * sizeof(int)) |
67 | printk(KERN_WARNING "Can't get bus-range for %s, assume" | 67 | printk(KERN_WARNING "Can't get bus-range for %s, assume" |
68 | " bus 0\n", dev->full_name); | 68 | " bus 0\n", dev->full_name); |
@@ -106,7 +106,7 @@ static void __init linkstation_init_IRQ(void) | |||
106 | { | 106 | { |
107 | struct mpic *mpic; | 107 | struct mpic *mpic; |
108 | struct device_node *dnp; | 108 | struct device_node *dnp; |
109 | void *prop; | 109 | const u32 *prop; |
110 | int size; | 110 | int size; |
111 | phys_addr_t paddr; | 111 | phys_addr_t paddr; |
112 | 112 | ||
@@ -114,7 +114,7 @@ static void __init linkstation_init_IRQ(void) | |||
114 | if (dnp == NULL) | 114 | if (dnp == NULL) |
115 | return; | 115 | return; |
116 | 116 | ||
117 | prop = (struct device_node *)get_property(dnp, "reg", &size); | 117 | prop = of_get_property(dnp, "reg", &size); |
118 | paddr = (phys_addr_t)of_translate_address(dnp, prop); | 118 | paddr = (phys_addr_t)of_translate_address(dnp, prop); |
119 | 119 | ||
120 | mpic = mpic_alloc(dnp, paddr, MPIC_PRIMARY | MPIC_WANTS_RESET, 4, 32, " EPIC "); | 120 | mpic = mpic_alloc(dnp, paddr, MPIC_PRIMARY | MPIC_WANTS_RESET, 4, 32, " EPIC "); |
diff --git a/arch/powerpc/platforms/embedded6xx/ls_uart.c b/arch/powerpc/platforms/embedded6xx/ls_uart.c index 0e837762cc5b..d0bee9f19e4e 100644 --- a/arch/powerpc/platforms/embedded6xx/ls_uart.c +++ b/arch/powerpc/platforms/embedded6xx/ls_uart.c | |||
@@ -110,8 +110,8 @@ static int __init ls_uarts_init(void) | |||
110 | if (!avr) | 110 | if (!avr) |
111 | return -EINVAL; | 111 | return -EINVAL; |
112 | 112 | ||
113 | avr_clock = *(u32*)get_property(avr, "clock-frequency", &len); | 113 | avr_clock = *(u32*)of_get_property(avr, "clock-frequency", &len); |
114 | phys_addr = ((u32*)get_property(avr, "reg", &len))[0]; | 114 | phys_addr = ((u32*)of_get_property(avr, "reg", &len))[0]; |
115 | 115 | ||
116 | if (!avr_clock || !phys_addr) | 116 | if (!avr_clock || !phys_addr) |
117 | return -EINVAL; | 117 | return -EINVAL; |
diff --git a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c index 604b47dd915c..c3f64ddb0be6 100644 --- a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c +++ b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c | |||
@@ -81,7 +81,7 @@ static void __init mpc7448_hpc2_setup_arch(void) | |||
81 | if (cpu != 0) { | 81 | if (cpu != 0) { |
82 | const unsigned int *fp; | 82 | const unsigned int *fp; |
83 | 83 | ||
84 | fp = get_property(cpu, "clock-frequency", NULL); | 84 | fp = of_get_property(cpu, "clock-frequency", NULL); |
85 | if (fp != 0) | 85 | if (fp != 0) |
86 | loops_per_jiffy = *fp / HZ; | 86 | loops_per_jiffy = *fp / HZ; |
87 | else | 87 | else |
@@ -132,7 +132,7 @@ static void __init mpc7448_hpc2_init_IRQ(void) | |||
132 | tsi_pic = of_find_node_by_type(NULL, "open-pic"); | 132 | tsi_pic = of_find_node_by_type(NULL, "open-pic"); |
133 | if (tsi_pic) { | 133 | if (tsi_pic) { |
134 | unsigned int size; | 134 | unsigned int size; |
135 | const void *prop = get_property(tsi_pic, "reg", &size); | 135 | const void *prop = of_get_property(tsi_pic, "reg", &size); |
136 | mpic_paddr = of_translate_address(tsi_pic, prop); | 136 | mpic_paddr = of_translate_address(tsi_pic, prop); |
137 | } | 137 | } |
138 | 138 | ||
diff --git a/arch/powerpc/platforms/iseries/iommu.c b/arch/powerpc/platforms/iseries/iommu.c index 7df2902271d0..3b6a9666c2c0 100644 --- a/arch/powerpc/platforms/iseries/iommu.c +++ b/arch/powerpc/platforms/iseries/iommu.c | |||
@@ -171,7 +171,7 @@ void iommu_devnode_init_iSeries(struct pci_dev *pdev, struct device_node *dn) | |||
171 | { | 171 | { |
172 | struct iommu_table *tbl; | 172 | struct iommu_table *tbl; |
173 | struct pci_dn *pdn = PCI_DN(dn); | 173 | struct pci_dn *pdn = PCI_DN(dn); |
174 | const u32 *lsn = get_property(dn, "linux,logical-slot-number", NULL); | 174 | const u32 *lsn = of_get_property(dn, "linux,logical-slot-number", NULL); |
175 | 175 | ||
176 | BUG_ON(lsn == NULL); | 176 | BUG_ON(lsn == NULL); |
177 | 177 | ||
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c index 404cf0696857..9c974227155e 100644 --- a/arch/powerpc/platforms/iseries/pci.c +++ b/arch/powerpc/platforms/iseries/pci.c | |||
@@ -176,7 +176,7 @@ void __init iSeries_pci_final_fixup(void) | |||
176 | struct pci_dn *pdn = PCI_DN(node); | 176 | struct pci_dn *pdn = PCI_DN(node); |
177 | const u32 *agent; | 177 | const u32 *agent; |
178 | 178 | ||
179 | agent = get_property(node, "linux,agent-id", NULL); | 179 | agent = of_get_property(node, "linux,agent-id", NULL); |
180 | if ((pdn != NULL) && (agent != NULL)) { | 180 | if ((pdn != NULL) && (agent != NULL)) { |
181 | u8 irq = iSeries_allocate_IRQ(pdn->busno, 0, | 181 | u8 irq = iSeries_allocate_IRQ(pdn->busno, 0, |
182 | pdn->bussubno); | 182 | pdn->bussubno); |
@@ -754,7 +754,7 @@ void __init iSeries_pcibios_init(void) | |||
754 | if ((node->type == NULL) || (strcmp(node->type, "pci") != 0)) | 754 | if ((node->type == NULL) || (strcmp(node->type, "pci") != 0)) |
755 | continue; | 755 | continue; |
756 | 756 | ||
757 | busp = get_property(node, "bus-range", NULL); | 757 | busp = of_get_property(node, "bus-range", NULL); |
758 | if (busp == NULL) | 758 | if (busp == NULL) |
759 | continue; | 759 | continue; |
760 | bus = *busp; | 760 | bus = *busp; |
diff --git a/arch/powerpc/platforms/iseries/viopath.c b/arch/powerpc/platforms/iseries/viopath.c index e2100ece9c65..2ca2d8a9de97 100644 --- a/arch/powerpc/platforms/iseries/viopath.c +++ b/arch/powerpc/platforms/iseries/viopath.c | |||
@@ -155,7 +155,7 @@ static int proc_viopath_show(struct seq_file *m, void *v) | |||
155 | node = of_find_node_by_path("/"); | 155 | node = of_find_node_by_path("/"); |
156 | sysid = NULL; | 156 | sysid = NULL; |
157 | if (node != NULL) | 157 | if (node != NULL) |
158 | sysid = get_property(node, "system-id", NULL); | 158 | sysid = of_get_property(node, "system-id", NULL); |
159 | 159 | ||
160 | if (sysid == NULL) | 160 | if (sysid == NULL) |
161 | seq_printf(m, "SRLNBR=<UNKNOWN>\n"); | 161 | seq_printf(m, "SRLNBR=<UNKNOWN>\n"); |
diff --git a/arch/powerpc/platforms/maple/pci.c b/arch/powerpc/platforms/maple/pci.c index ab5a6f12e1f0..b1d3b99c3f9d 100644 --- a/arch/powerpc/platforms/maple/pci.c +++ b/arch/powerpc/platforms/maple/pci.c | |||
@@ -44,11 +44,11 @@ static int __init fixup_one_level_bus_range(struct device_node *node, int higher | |||
44 | int len; | 44 | int len; |
45 | 45 | ||
46 | /* For PCI<->PCI bridges or CardBus bridges, we go down */ | 46 | /* For PCI<->PCI bridges or CardBus bridges, we go down */ |
47 | class_code = get_property(node, "class-code", NULL); | 47 | class_code = of_get_property(node, "class-code", NULL); |
48 | if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI && | 48 | if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI && |
49 | (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) | 49 | (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) |
50 | continue; | 50 | continue; |
51 | bus_range = get_property(node, "bus-range", &len); | 51 | bus_range = of_get_property(node, "bus-range", &len); |
52 | if (bus_range != NULL && len > 2 * sizeof(int)) { | 52 | if (bus_range != NULL && len > 2 * sizeof(int)) { |
53 | if (bus_range[1] > higher) | 53 | if (bus_range[1] > higher) |
54 | higher = bus_range[1]; | 54 | higher = bus_range[1]; |
@@ -454,7 +454,7 @@ static int __init add_bridge(struct device_node *dev) | |||
454 | 454 | ||
455 | DBG("Adding PCI host bridge %s\n", dev->full_name); | 455 | DBG("Adding PCI host bridge %s\n", dev->full_name); |
456 | 456 | ||
457 | bus_range = get_property(dev, "bus-range", &len); | 457 | bus_range = of_get_property(dev, "bus-range", &len); |
458 | if (bus_range == NULL || len < 2 * sizeof(int)) { | 458 | if (bus_range == NULL || len < 2 * sizeof(int)) { |
459 | printk(KERN_WARNING "Can't get bus-range for %s, assume bus 0\n", | 459 | printk(KERN_WARNING "Can't get bus-range for %s, assume bus 0\n", |
460 | dev->full_name); | 460 | dev->full_name); |
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c index f21add0e4786..120cd048e0cc 100644 --- a/arch/powerpc/platforms/maple/setup.c +++ b/arch/powerpc/platforms/maple/setup.c | |||
@@ -113,8 +113,8 @@ static void maple_restart(char *cmd) | |||
113 | printk(KERN_EMERG "Maple: Unable to find Service Processor\n"); | 113 | printk(KERN_EMERG "Maple: Unable to find Service Processor\n"); |
114 | goto fail; | 114 | goto fail; |
115 | } | 115 | } |
116 | maple_nvram_offset = get_property(sp, "restart-addr", NULL); | 116 | maple_nvram_offset = of_get_property(sp, "restart-addr", NULL); |
117 | maple_nvram_command = get_property(sp, "restart-value", NULL); | 117 | maple_nvram_command = of_get_property(sp, "restart-value", NULL); |
118 | of_node_put(sp); | 118 | of_node_put(sp); |
119 | 119 | ||
120 | /* send command */ | 120 | /* send command */ |
@@ -140,8 +140,8 @@ static void maple_power_off(void) | |||
140 | printk(KERN_EMERG "Maple: Unable to find Service Processor\n"); | 140 | printk(KERN_EMERG "Maple: Unable to find Service Processor\n"); |
141 | goto fail; | 141 | goto fail; |
142 | } | 142 | } |
143 | maple_nvram_offset = get_property(sp, "power-off-addr", NULL); | 143 | maple_nvram_offset = of_get_property(sp, "power-off-addr", NULL); |
144 | maple_nvram_command = get_property(sp, "power-off-value", NULL); | 144 | maple_nvram_command = of_get_property(sp, "power-off-value", NULL); |
145 | of_node_put(sp); | 145 | of_node_put(sp); |
146 | 146 | ||
147 | /* send command */ | 147 | /* send command */ |
@@ -249,7 +249,7 @@ static void __init maple_init_IRQ(void) | |||
249 | /* Find address list in /platform-open-pic */ | 249 | /* Find address list in /platform-open-pic */ |
250 | root = of_find_node_by_path("/"); | 250 | root = of_find_node_by_path("/"); |
251 | naddr = of_n_addr_cells(root); | 251 | naddr = of_n_addr_cells(root); |
252 | opprop = get_property(root, "platform-open-pic", &opplen); | 252 | opprop = of_get_property(root, "platform-open-pic", &opplen); |
253 | if (opprop != 0) { | 253 | if (opprop != 0) { |
254 | openpic_addr = of_read_number(opprop, naddr); | 254 | openpic_addr = of_read_number(opprop, naddr); |
255 | has_isus = (opplen > naddr); | 255 | has_isus = (opplen > naddr); |
@@ -260,7 +260,7 @@ static void __init maple_init_IRQ(void) | |||
260 | BUG_ON(openpic_addr == 0); | 260 | BUG_ON(openpic_addr == 0); |
261 | 261 | ||
262 | /* Check for a big endian MPIC */ | 262 | /* Check for a big endian MPIC */ |
263 | if (get_property(np, "big-endian", NULL) != NULL) | 263 | if (of_get_property(np, "big-endian", NULL) != NULL) |
264 | flags |= MPIC_BIG_ENDIAN; | 264 | flags |= MPIC_BIG_ENDIAN; |
265 | 265 | ||
266 | /* XXX Maple specific bits */ | 266 | /* XXX Maple specific bits */ |
diff --git a/arch/powerpc/platforms/pasemi/iommu.c b/arch/powerpc/platforms/pasemi/iommu.c index 07819cd3ac44..95fa6a7d15ee 100644 --- a/arch/powerpc/platforms/pasemi/iommu.c +++ b/arch/powerpc/platforms/pasemi/iommu.c | |||
@@ -249,7 +249,7 @@ void iommu_init_early_pasemi(void) | |||
249 | iommu_off = 1; | 249 | iommu_off = 1; |
250 | #else | 250 | #else |
251 | iommu_off = of_chosen && | 251 | iommu_off = of_chosen && |
252 | get_property(of_chosen, "linux,iommu-off", NULL); | 252 | of_get_property(of_chosen, "linux,iommu-off", NULL); |
253 | #endif | 253 | #endif |
254 | if (iommu_off) { | 254 | if (iommu_off) { |
255 | /* Direct I/O, IOMMU off */ | 255 | /* Direct I/O, IOMMU off */ |
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c index d4fd61328c8b..32a614cacf24 100644 --- a/arch/powerpc/platforms/pasemi/setup.c +++ b/arch/powerpc/platforms/pasemi/setup.c | |||
@@ -137,7 +137,7 @@ static __init void pas_init_IRQ(void) | |||
137 | /* Find address list in /platform-open-pic */ | 137 | /* Find address list in /platform-open-pic */ |
138 | root = of_find_node_by_path("/"); | 138 | root = of_find_node_by_path("/"); |
139 | naddr = of_n_addr_cells(root); | 139 | naddr = of_n_addr_cells(root); |
140 | opprop = get_property(root, "platform-open-pic", &opplen); | 140 | opprop = of_get_property(root, "platform-open-pic", &opplen); |
141 | if (!opprop) { | 141 | if (!opprop) { |
142 | printk(KERN_ERR "No platform-open-pic property.\n"); | 142 | printk(KERN_ERR "No platform-open-pic property.\n"); |
143 | of_node_put(root); | 143 | of_node_put(root); |
diff --git a/arch/powerpc/platforms/powermac/backlight.c b/arch/powerpc/platforms/powermac/backlight.c index de7440e62cc4..0dc8a45c408a 100644 --- a/arch/powerpc/platforms/powermac/backlight.c +++ b/arch/powerpc/platforms/powermac/backlight.c | |||
@@ -59,7 +59,7 @@ int pmac_has_backlight_type(const char *type) | |||
59 | struct device_node* bk_node = find_devices("backlight"); | 59 | struct device_node* bk_node = find_devices("backlight"); |
60 | 60 | ||
61 | if (bk_node) { | 61 | if (bk_node) { |
62 | const char *prop = get_property(bk_node, | 62 | const char *prop = of_get_property(bk_node, |
63 | "backlight-control", NULL); | 63 | "backlight-control", NULL); |
64 | if (prop && strncmp(prop, type, strlen(type)) == 0) | 64 | if (prop && strncmp(prop, type, strlen(type)) == 0) |
65 | return 1; | 65 | return 1; |
diff --git a/arch/powerpc/platforms/powermac/cpufreq_32.c b/arch/powerpc/platforms/powermac/cpufreq_32.c index c2b6b4134f68..76eda9fcd1aa 100644 --- a/arch/powerpc/platforms/powermac/cpufreq_32.c +++ b/arch/powerpc/platforms/powermac/cpufreq_32.c | |||
@@ -421,7 +421,7 @@ static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
421 | 421 | ||
422 | static u32 read_gpio(struct device_node *np) | 422 | static u32 read_gpio(struct device_node *np) |
423 | { | 423 | { |
424 | const u32 *reg = get_property(np, "reg", NULL); | 424 | const u32 *reg = of_get_property(np, "reg", NULL); |
425 | u32 offset; | 425 | u32 offset; |
426 | 426 | ||
427 | if (reg == NULL) | 427 | if (reg == NULL) |
@@ -521,13 +521,14 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode) | |||
521 | int lenp, rc; | 521 | int lenp, rc; |
522 | const u32 *freqs, *ratio; | 522 | const u32 *freqs, *ratio; |
523 | 523 | ||
524 | freqs = get_property(cpunode, "bus-frequencies", &lenp); | 524 | freqs = of_get_property(cpunode, "bus-frequencies", &lenp); |
525 | lenp /= sizeof(u32); | 525 | lenp /= sizeof(u32); |
526 | if (freqs == NULL || lenp != 2) { | 526 | if (freqs == NULL || lenp != 2) { |
527 | printk(KERN_ERR "cpufreq: bus-frequencies incorrect or missing\n"); | 527 | printk(KERN_ERR "cpufreq: bus-frequencies incorrect or missing\n"); |
528 | return 1; | 528 | return 1; |
529 | } | 529 | } |
530 | ratio = get_property(cpunode, "processor-to-bus-ratio*2", NULL); | 530 | ratio = of_get_property(cpunode, "processor-to-bus-ratio*2", |
531 | NULL); | ||
531 | if (ratio == NULL) { | 532 | if (ratio == NULL) { |
532 | printk(KERN_ERR "cpufreq: processor-to-bus-ratio*2 missing\n"); | 533 | printk(KERN_ERR "cpufreq: processor-to-bus-ratio*2 missing\n"); |
533 | return 1; | 534 | return 1; |
@@ -562,7 +563,7 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode) | |||
562 | /* If we use the PMU, look for the min & max frequencies in the | 563 | /* If we use the PMU, look for the min & max frequencies in the |
563 | * device-tree | 564 | * device-tree |
564 | */ | 565 | */ |
565 | value = get_property(cpunode, "min-clock-frequency", NULL); | 566 | value = of_get_property(cpunode, "min-clock-frequency", NULL); |
566 | if (!value) | 567 | if (!value) |
567 | return 1; | 568 | return 1; |
568 | low_freq = (*value) / 1000; | 569 | low_freq = (*value) / 1000; |
@@ -571,7 +572,7 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode) | |||
571 | if (low_freq < 100000) | 572 | if (low_freq < 100000) |
572 | low_freq *= 10; | 573 | low_freq *= 10; |
573 | 574 | ||
574 | value = get_property(cpunode, "max-clock-frequency", NULL); | 575 | value = of_get_property(cpunode, "max-clock-frequency", NULL); |
575 | if (!value) | 576 | if (!value) |
576 | return 1; | 577 | return 1; |
577 | hi_freq = (*value) / 1000; | 578 | hi_freq = (*value) / 1000; |
@@ -585,7 +586,7 @@ static int pmac_cpufreq_init_7447A(struct device_node *cpunode) | |||
585 | { | 586 | { |
586 | struct device_node *volt_gpio_np; | 587 | struct device_node *volt_gpio_np; |
587 | 588 | ||
588 | if (get_property(cpunode, "dynamic-power-step", NULL) == NULL) | 589 | if (of_get_property(cpunode, "dynamic-power-step", NULL) == NULL) |
589 | return 1; | 590 | return 1; |
590 | 591 | ||
591 | volt_gpio_np = of_find_node_by_name(NULL, "cpu-vcore-select"); | 592 | volt_gpio_np = of_find_node_by_name(NULL, "cpu-vcore-select"); |
@@ -614,11 +615,11 @@ static int pmac_cpufreq_init_750FX(struct device_node *cpunode) | |||
614 | u32 pvr; | 615 | u32 pvr; |
615 | const u32 *value; | 616 | const u32 *value; |
616 | 617 | ||
617 | if (get_property(cpunode, "dynamic-power-step", NULL) == NULL) | 618 | if (of_get_property(cpunode, "dynamic-power-step", NULL) == NULL) |
618 | return 1; | 619 | return 1; |
619 | 620 | ||
620 | hi_freq = cur_freq; | 621 | hi_freq = cur_freq; |
621 | value = get_property(cpunode, "reduced-clock-frequency", NULL); | 622 | value = of_get_property(cpunode, "reduced-clock-frequency", NULL); |
622 | if (!value) | 623 | if (!value) |
623 | return 1; | 624 | return 1; |
624 | low_freq = (*value) / 1000; | 625 | low_freq = (*value) / 1000; |
@@ -662,14 +663,14 @@ static int __init pmac_cpufreq_setup(void) | |||
662 | goto out; | 663 | goto out; |
663 | 664 | ||
664 | /* Get current cpu clock freq */ | 665 | /* Get current cpu clock freq */ |
665 | value = get_property(cpunode, "clock-frequency", NULL); | 666 | value = of_get_property(cpunode, "clock-frequency", NULL); |
666 | if (!value) | 667 | if (!value) |
667 | goto out; | 668 | goto out; |
668 | cur_freq = (*value) / 1000; | 669 | cur_freq = (*value) / 1000; |
669 | 670 | ||
670 | /* Check for 7447A based MacRISC3 */ | 671 | /* Check for 7447A based MacRISC3 */ |
671 | if (machine_is_compatible("MacRISC3") && | 672 | if (machine_is_compatible("MacRISC3") && |
672 | get_property(cpunode, "dynamic-power-step", NULL) && | 673 | of_get_property(cpunode, "dynamic-power-step", NULL) && |
673 | PVR_VER(mfspr(SPRN_PVR)) == 0x8003) { | 674 | PVR_VER(mfspr(SPRN_PVR)) == 0x8003) { |
674 | pmac_cpufreq_init_7447A(cpunode); | 675 | pmac_cpufreq_init_7447A(cpunode); |
675 | /* Check for other MacRISC3 machines */ | 676 | /* Check for other MacRISC3 machines */ |
diff --git a/arch/powerpc/platforms/powermac/cpufreq_64.c b/arch/powerpc/platforms/powermac/cpufreq_64.c index 9d22361a26d6..567d5523b690 100644 --- a/arch/powerpc/platforms/powermac/cpufreq_64.c +++ b/arch/powerpc/platforms/powermac/cpufreq_64.c | |||
@@ -410,7 +410,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus) | |||
410 | /* Get first CPU node */ | 410 | /* Get first CPU node */ |
411 | for (cpunode = NULL; | 411 | for (cpunode = NULL; |
412 | (cpunode = of_get_next_child(cpus, cpunode)) != NULL;) { | 412 | (cpunode = of_get_next_child(cpus, cpunode)) != NULL;) { |
413 | const u32 *reg = get_property(cpunode, "reg", NULL); | 413 | const u32 *reg = of_get_property(cpunode, "reg", NULL); |
414 | if (reg == NULL || (*reg) != 0) | 414 | if (reg == NULL || (*reg) != 0) |
415 | continue; | 415 | continue; |
416 | if (!strcmp(cpunode->type, "cpu")) | 416 | if (!strcmp(cpunode->type, "cpu")) |
@@ -422,7 +422,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus) | |||
422 | } | 422 | } |
423 | 423 | ||
424 | /* Check 970FX for now */ | 424 | /* Check 970FX for now */ |
425 | valp = get_property(cpunode, "cpu-version", NULL); | 425 | valp = of_get_property(cpunode, "cpu-version", NULL); |
426 | if (!valp) { | 426 | if (!valp) { |
427 | DBG("No cpu-version property !\n"); | 427 | DBG("No cpu-version property !\n"); |
428 | goto bail_noprops; | 428 | goto bail_noprops; |
@@ -434,7 +434,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus) | |||
434 | } | 434 | } |
435 | 435 | ||
436 | /* Look for the powertune data in the device-tree */ | 436 | /* Look for the powertune data in the device-tree */ |
437 | g5_pmode_data = get_property(cpunode, "power-mode-data",&psize); | 437 | g5_pmode_data = of_get_property(cpunode, "power-mode-data",&psize); |
438 | if (!g5_pmode_data) { | 438 | if (!g5_pmode_data) { |
439 | DBG("No power-mode-data !\n"); | 439 | DBG("No power-mode-data !\n"); |
440 | goto bail_noprops; | 440 | goto bail_noprops; |
@@ -493,7 +493,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus) | |||
493 | * half freq in this version. So far, I haven't yet seen a machine | 493 | * half freq in this version. So far, I haven't yet seen a machine |
494 | * supporting anything else. | 494 | * supporting anything else. |
495 | */ | 495 | */ |
496 | valp = get_property(cpunode, "clock-frequency", NULL); | 496 | valp = of_get_property(cpunode, "clock-frequency", NULL); |
497 | if (!valp) | 497 | if (!valp) |
498 | return -ENODEV; | 498 | return -ENODEV; |
499 | max_freq = (*valp)/1000; | 499 | max_freq = (*valp)/1000; |
@@ -563,7 +563,7 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus) | |||
563 | /* Lookup the cpuid eeprom node */ | 563 | /* Lookup the cpuid eeprom node */ |
564 | cpuid = of_find_node_by_path("/u3@0,f8000000/i2c@f8001000/cpuid@a0"); | 564 | cpuid = of_find_node_by_path("/u3@0,f8000000/i2c@f8001000/cpuid@a0"); |
565 | if (cpuid != NULL) | 565 | if (cpuid != NULL) |
566 | eeprom = get_property(cpuid, "cpuid", NULL); | 566 | eeprom = of_get_property(cpuid, "cpuid", NULL); |
567 | if (eeprom == NULL) { | 567 | if (eeprom == NULL) { |
568 | printk(KERN_ERR "cpufreq: Can't find cpuid EEPROM !\n"); | 568 | printk(KERN_ERR "cpufreq: Can't find cpuid EEPROM !\n"); |
569 | rc = -ENODEV; | 569 | rc = -ENODEV; |
@@ -573,13 +573,13 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus) | |||
573 | /* Lookup the i2c hwclock */ | 573 | /* Lookup the i2c hwclock */ |
574 | for (hwclock = NULL; | 574 | for (hwclock = NULL; |
575 | (hwclock = of_find_node_by_name(hwclock, "i2c-hwclock")) != NULL;){ | 575 | (hwclock = of_find_node_by_name(hwclock, "i2c-hwclock")) != NULL;){ |
576 | const char *loc = get_property(hwclock, | 576 | const char *loc = of_get_property(hwclock, |
577 | "hwctrl-location", NULL); | 577 | "hwctrl-location", NULL); |
578 | if (loc == NULL) | 578 | if (loc == NULL) |
579 | continue; | 579 | continue; |
580 | if (strcmp(loc, "CPU CLOCK")) | 580 | if (strcmp(loc, "CPU CLOCK")) |
581 | continue; | 581 | continue; |
582 | if (!get_property(hwclock, "platform-get-frequency", NULL)) | 582 | if (!of_get_property(hwclock, "platform-get-frequency", NULL)) |
583 | continue; | 583 | continue; |
584 | break; | 584 | break; |
585 | } | 585 | } |
@@ -638,7 +638,7 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus) | |||
638 | */ | 638 | */ |
639 | 639 | ||
640 | /* Get max frequency from device-tree */ | 640 | /* Get max frequency from device-tree */ |
641 | valp = get_property(cpunode, "clock-frequency", NULL); | 641 | valp = of_get_property(cpunode, "clock-frequency", NULL); |
642 | if (!valp) { | 642 | if (!valp) { |
643 | printk(KERN_ERR "cpufreq: Can't find CPU frequency !\n"); | 643 | printk(KERN_ERR "cpufreq: Can't find CPU frequency !\n"); |
644 | rc = -ENODEV; | 644 | rc = -ENODEV; |
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c index 24cc50c1774a..103fcc4c5605 100644 --- a/arch/powerpc/platforms/powermac/feature.c +++ b/arch/powerpc/platforms/powermac/feature.c | |||
@@ -1057,8 +1057,8 @@ core99_reset_cpu(struct device_node *node, long param, long value) | |||
1057 | if (np == NULL) | 1057 | if (np == NULL) |
1058 | return -ENODEV; | 1058 | return -ENODEV; |
1059 | for (np = np->child; np != NULL; np = np->sibling) { | 1059 | for (np = np->child; np != NULL; np = np->sibling) { |
1060 | const u32 *num = get_property(np, "reg", NULL); | 1060 | const u32 *num = of_get_property(np, "reg", NULL); |
1061 | const u32 *rst = get_property(np, "soft-reset", NULL); | 1061 | const u32 *rst = of_get_property(np, "soft-reset", NULL); |
1062 | if (num == NULL || rst == NULL) | 1062 | if (num == NULL || rst == NULL) |
1063 | continue; | 1063 | continue; |
1064 | if (param == *num) { | 1064 | if (param == *num) { |
@@ -1095,7 +1095,7 @@ core99_usb_enable(struct device_node *node, long param, long value) | |||
1095 | macio->type != macio_intrepid) | 1095 | macio->type != macio_intrepid) |
1096 | return -ENODEV; | 1096 | return -ENODEV; |
1097 | 1097 | ||
1098 | prop = get_property(node, "AAPL,clock-id", NULL); | 1098 | prop = of_get_property(node, "AAPL,clock-id", NULL); |
1099 | if (!prop) | 1099 | if (!prop) |
1100 | return -ENODEV; | 1100 | return -ENODEV; |
1101 | if (strncmp(prop, "usb0u048", 8) == 0) | 1101 | if (strncmp(prop, "usb0u048", 8) == 0) |
@@ -1506,8 +1506,8 @@ static long g5_reset_cpu(struct device_node *node, long param, long value) | |||
1506 | if (np == NULL) | 1506 | if (np == NULL) |
1507 | return -ENODEV; | 1507 | return -ENODEV; |
1508 | for (np = np->child; np != NULL; np = np->sibling) { | 1508 | for (np = np->child; np != NULL; np = np->sibling) { |
1509 | const u32 *num = get_property(np, "reg", NULL); | 1509 | const u32 *num = of_get_property(np, "reg", NULL); |
1510 | const u32 *rst = get_property(np, "soft-reset", NULL); | 1510 | const u32 *rst = of_get_property(np, "soft-reset", NULL); |
1511 | if (num == NULL || rst == NULL) | 1511 | if (num == NULL || rst == NULL) |
1512 | continue; | 1512 | continue; |
1513 | if (param == *num) { | 1513 | if (param == *num) { |
@@ -2411,7 +2411,7 @@ static int __init probe_motherboard(void) | |||
2411 | */ | 2411 | */ |
2412 | dt = find_devices("device-tree"); | 2412 | dt = find_devices("device-tree"); |
2413 | if (dt != NULL) | 2413 | if (dt != NULL) |
2414 | model = get_property(dt, "model", NULL); | 2414 | model = of_get_property(dt, "model", NULL); |
2415 | for(i=0; model && i<(sizeof(pmac_mb_defs)/sizeof(struct pmac_mb_def)); i++) { | 2415 | for(i=0; model && i<(sizeof(pmac_mb_defs)/sizeof(struct pmac_mb_def)); i++) { |
2416 | if (strcmp(model, pmac_mb_defs[i].model_string) == 0) { | 2416 | if (strcmp(model, pmac_mb_defs[i].model_string) == 0) { |
2417 | pmac_mb = pmac_mb_defs[i]; | 2417 | pmac_mb = pmac_mb_defs[i]; |
@@ -2509,7 +2509,7 @@ found: | |||
2509 | if (np->sibling) | 2509 | if (np->sibling) |
2510 | break; | 2510 | break; |
2511 | /* Nap mode not supported if flush-on-lock property is present */ | 2511 | /* Nap mode not supported if flush-on-lock property is present */ |
2512 | if (get_property(np, "flush-on-lock", NULL)) | 2512 | if (of_get_property(np, "flush-on-lock", NULL)) |
2513 | break; | 2513 | break; |
2514 | powersave_nap = 1; | 2514 | powersave_nap = 1; |
2515 | printk(KERN_DEBUG "Processor NAP mode on idle enabled.\n"); | 2515 | printk(KERN_DEBUG "Processor NAP mode on idle enabled.\n"); |
@@ -2558,7 +2558,7 @@ static void __init probe_uninorth(void) | |||
2558 | if (uninorth_node == NULL) | 2558 | if (uninorth_node == NULL) |
2559 | return; | 2559 | return; |
2560 | 2560 | ||
2561 | addrp = get_property(uninorth_node, "reg", NULL); | 2561 | addrp = of_get_property(uninorth_node, "reg", NULL); |
2562 | if (addrp == NULL) | 2562 | if (addrp == NULL) |
2563 | return; | 2563 | return; |
2564 | address = of_translate_address(uninorth_node, addrp); | 2564 | address = of_translate_address(uninorth_node, addrp); |
@@ -2642,7 +2642,7 @@ static void __init probe_one_macio(const char *name, const char *compat, int typ | |||
2642 | return; | 2642 | return; |
2643 | } | 2643 | } |
2644 | if (type == macio_keylargo || type == macio_keylargo2) { | 2644 | if (type == macio_keylargo || type == macio_keylargo2) { |
2645 | const u32 *did = get_property(node, "device-id", NULL); | 2645 | const u32 *did = of_get_property(node, "device-id", NULL); |
2646 | if (*did == 0x00000025) | 2646 | if (*did == 0x00000025) |
2647 | type = macio_pangea; | 2647 | type = macio_pangea; |
2648 | if (*did == 0x0000003e) | 2648 | if (*did == 0x0000003e) |
@@ -2655,7 +2655,7 @@ static void __init probe_one_macio(const char *name, const char *compat, int typ | |||
2655 | macio_chips[i].base = base; | 2655 | macio_chips[i].base = base; |
2656 | macio_chips[i].flags = MACIO_FLAG_SCCB_ON | MACIO_FLAG_SCCB_ON; | 2656 | macio_chips[i].flags = MACIO_FLAG_SCCB_ON | MACIO_FLAG_SCCB_ON; |
2657 | macio_chips[i].name = macio_names[type]; | 2657 | macio_chips[i].name = macio_names[type]; |
2658 | revp = get_property(node, "revision-id", NULL); | 2658 | revp = of_get_property(node, "revision-id", NULL); |
2659 | if (revp) | 2659 | if (revp) |
2660 | macio_chips[i].rev = *revp; | 2660 | macio_chips[i].rev = *revp; |
2661 | printk(KERN_INFO "Found a %s mac-io controller, rev: %d, mapped at 0x%p\n", | 2661 | printk(KERN_INFO "Found a %s mac-io controller, rev: %d, mapped at 0x%p\n", |
@@ -2706,8 +2706,8 @@ initial_serial_shutdown(struct device_node *np) | |||
2706 | int port_type = PMAC_SCC_ASYNC; | 2706 | int port_type = PMAC_SCC_ASYNC; |
2707 | int modem = 0; | 2707 | int modem = 0; |
2708 | 2708 | ||
2709 | slots = get_property(np, "slot-names", &len); | 2709 | slots = of_get_property(np, "slot-names", &len); |
2710 | conn = get_property(np, "AAPL,connector", &len); | 2710 | conn = of_get_property(np, "AAPL,connector", &len); |
2711 | if (conn && (strcmp(conn, "infrared") == 0)) | 2711 | if (conn && (strcmp(conn, "infrared") == 0)) |
2712 | port_type = PMAC_SCC_IRDA; | 2712 | port_type = PMAC_SCC_IRDA; |
2713 | else if (device_is_compatible(np, "cobalt")) | 2713 | else if (device_is_compatible(np, "cobalt")) |
diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c index bfc4829162f1..5430e146b3e9 100644 --- a/arch/powerpc/platforms/powermac/low_i2c.c +++ b/arch/powerpc/platforms/powermac/low_i2c.c | |||
@@ -491,7 +491,7 @@ static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np) | |||
491 | * on all i2c keywest nodes so far ... we would have to fallback | 491 | * on all i2c keywest nodes so far ... we would have to fallback |
492 | * to macio parsing if that wasn't the case | 492 | * to macio parsing if that wasn't the case |
493 | */ | 493 | */ |
494 | addrp = get_property(np, "AAPL,address", NULL); | 494 | addrp = of_get_property(np, "AAPL,address", NULL); |
495 | if (addrp == NULL) { | 495 | if (addrp == NULL) { |
496 | printk(KERN_ERR "low_i2c: Can't find address for %s\n", | 496 | printk(KERN_ERR "low_i2c: Can't find address for %s\n", |
497 | np->full_name); | 497 | np->full_name); |
@@ -505,13 +505,13 @@ static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np) | |||
505 | host->timeout_timer.function = kw_i2c_timeout; | 505 | host->timeout_timer.function = kw_i2c_timeout; |
506 | host->timeout_timer.data = (unsigned long)host; | 506 | host->timeout_timer.data = (unsigned long)host; |
507 | 507 | ||
508 | psteps = get_property(np, "AAPL,address-step", NULL); | 508 | psteps = of_get_property(np, "AAPL,address-step", NULL); |
509 | steps = psteps ? (*psteps) : 0x10; | 509 | steps = psteps ? (*psteps) : 0x10; |
510 | for (host->bsteps = 0; (steps & 0x01) == 0; host->bsteps++) | 510 | for (host->bsteps = 0; (steps & 0x01) == 0; host->bsteps++) |
511 | steps >>= 1; | 511 | steps >>= 1; |
512 | /* Select interface rate */ | 512 | /* Select interface rate */ |
513 | host->speed = KW_I2C_MODE_25KHZ; | 513 | host->speed = KW_I2C_MODE_25KHZ; |
514 | prate = get_property(np, "AAPL,i2c-rate", NULL); | 514 | prate = of_get_property(np, "AAPL,i2c-rate", NULL); |
515 | if (prate) switch(*prate) { | 515 | if (prate) switch(*prate) { |
516 | case 100: | 516 | case 100: |
517 | host->speed = KW_I2C_MODE_100KHZ; | 517 | host->speed = KW_I2C_MODE_100KHZ; |
@@ -619,7 +619,7 @@ static void __init kw_i2c_probe(void) | |||
619 | } else { | 619 | } else { |
620 | for (child = NULL; | 620 | for (child = NULL; |
621 | (child = of_get_next_child(np, child)) != NULL;) { | 621 | (child = of_get_next_child(np, child)) != NULL;) { |
622 | const u32 *reg = get_property(child, | 622 | const u32 *reg = of_get_property(child, |
623 | "reg", NULL); | 623 | "reg", NULL); |
624 | if (reg == NULL) | 624 | if (reg == NULL) |
625 | continue; | 625 | continue; |
@@ -905,7 +905,7 @@ static void __init smu_i2c_probe(void) | |||
905 | if (strcmp(busnode->type, "i2c") && | 905 | if (strcmp(busnode->type, "i2c") && |
906 | strcmp(busnode->type, "i2c-bus")) | 906 | strcmp(busnode->type, "i2c-bus")) |
907 | continue; | 907 | continue; |
908 | reg = get_property(busnode, "reg", NULL); | 908 | reg = of_get_property(busnode, "reg", NULL); |
909 | if (reg == NULL) | 909 | if (reg == NULL) |
910 | continue; | 910 | continue; |
911 | 911 | ||
@@ -950,7 +950,8 @@ struct pmac_i2c_bus *pmac_i2c_find_bus(struct device_node *node) | |||
950 | if (p == bus->busnode) { | 950 | if (p == bus->busnode) { |
951 | if (prev && bus->flags & pmac_i2c_multibus) { | 951 | if (prev && bus->flags & pmac_i2c_multibus) { |
952 | const u32 *reg; | 952 | const u32 *reg; |
953 | reg = get_property(prev, "reg", NULL); | 953 | reg = of_get_property(prev, "reg", |
954 | NULL); | ||
954 | if (!reg) | 955 | if (!reg) |
955 | continue; | 956 | continue; |
956 | if (((*reg) >> 8) != bus->channel) | 957 | if (((*reg) >> 8) != bus->channel) |
@@ -971,7 +972,7 @@ EXPORT_SYMBOL_GPL(pmac_i2c_find_bus); | |||
971 | 972 | ||
972 | u8 pmac_i2c_get_dev_addr(struct device_node *device) | 973 | u8 pmac_i2c_get_dev_addr(struct device_node *device) |
973 | { | 974 | { |
974 | const u32 *reg = get_property(device, "reg", NULL); | 975 | const u32 *reg = of_get_property(device, "reg", NULL); |
975 | 976 | ||
976 | if (reg == NULL) | 977 | if (reg == NULL) |
977 | return 0; | 978 | return 0; |
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c index 431a685a15dd..092cef4160a1 100644 --- a/arch/powerpc/platforms/powermac/pci.c +++ b/arch/powerpc/platforms/powermac/pci.c | |||
@@ -70,11 +70,11 @@ static int __init fixup_one_level_bus_range(struct device_node *node, int higher | |||
70 | int len; | 70 | int len; |
71 | 71 | ||
72 | /* For PCI<->PCI bridges or CardBus bridges, we go down */ | 72 | /* For PCI<->PCI bridges or CardBus bridges, we go down */ |
73 | class_code = get_property(node, "class-code", NULL); | 73 | class_code = of_get_property(node, "class-code", NULL); |
74 | if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI && | 74 | if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI && |
75 | (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) | 75 | (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) |
76 | continue; | 76 | continue; |
77 | bus_range = get_property(node, "bus-range", &len); | 77 | bus_range = of_get_property(node, "bus-range", &len); |
78 | if (bus_range != NULL && len > 2 * sizeof(int)) { | 78 | if (bus_range != NULL && len > 2 * sizeof(int)) { |
79 | if (bus_range[1] > higher) | 79 | if (bus_range[1] > higher) |
80 | higher = bus_range[1]; | 80 | higher = bus_range[1]; |
@@ -246,8 +246,8 @@ static int chaos_validate_dev(struct pci_bus *bus, int devfn, int offset) | |||
246 | if (np == NULL) | 246 | if (np == NULL) |
247 | return PCIBIOS_DEVICE_NOT_FOUND; | 247 | return PCIBIOS_DEVICE_NOT_FOUND; |
248 | 248 | ||
249 | vendor = get_property(np, "vendor-id", NULL); | 249 | vendor = of_get_property(np, "vendor-id", NULL); |
250 | device = get_property(np, "device-id", NULL); | 250 | device = of_get_property(np, "device-id", NULL); |
251 | if (vendor == NULL || device == NULL) | 251 | if (vendor == NULL || device == NULL) |
252 | return PCIBIOS_DEVICE_NOT_FOUND; | 252 | return PCIBIOS_DEVICE_NOT_FOUND; |
253 | 253 | ||
@@ -691,17 +691,17 @@ static void __init fixup_nec_usb2(void) | |||
691 | const u32 *prop; | 691 | const u32 *prop; |
692 | u8 bus, devfn; | 692 | u8 bus, devfn; |
693 | 693 | ||
694 | prop = get_property(nec, "vendor-id", NULL); | 694 | prop = of_get_property(nec, "vendor-id", NULL); |
695 | if (prop == NULL) | 695 | if (prop == NULL) |
696 | continue; | 696 | continue; |
697 | if (0x1033 != *prop) | 697 | if (0x1033 != *prop) |
698 | continue; | 698 | continue; |
699 | prop = get_property(nec, "device-id", NULL); | 699 | prop = of_get_property(nec, "device-id", NULL); |
700 | if (prop == NULL) | 700 | if (prop == NULL) |
701 | continue; | 701 | continue; |
702 | if (0x0035 != *prop) | 702 | if (0x0035 != *prop) |
703 | continue; | 703 | continue; |
704 | prop = get_property(nec, "reg", NULL); | 704 | prop = of_get_property(nec, "reg", NULL); |
705 | if (prop == NULL) | 705 | if (prop == NULL) |
706 | continue; | 706 | continue; |
707 | devfn = (prop[0] >> 8) & 0xff; | 707 | devfn = (prop[0] >> 8) & 0xff; |
@@ -909,7 +909,7 @@ static int __init add_bridge(struct device_node *dev) | |||
909 | has_address = (of_address_to_resource(dev, 0, &rsrc) == 0); | 909 | has_address = (of_address_to_resource(dev, 0, &rsrc) == 0); |
910 | 910 | ||
911 | /* Get bus range if any */ | 911 | /* Get bus range if any */ |
912 | bus_range = get_property(dev, "bus-range", &len); | 912 | bus_range = of_get_property(dev, "bus-range", &len); |
913 | if (bus_range == NULL || len < 2 * sizeof(int)) { | 913 | if (bus_range == NULL || len < 2 * sizeof(int)) { |
914 | printk(KERN_WARNING "Can't get bus-range for %s, assume" | 914 | printk(KERN_WARNING "Can't get bus-range for %s, assume" |
915 | " bus 0\n", dev->full_name); | 915 | " bus 0\n", dev->full_name); |
diff --git a/arch/powerpc/platforms/powermac/pfunc_base.c b/arch/powerpc/platforms/powermac/pfunc_base.c index 5c6c15c5f9a3..45d54b9ad9e0 100644 --- a/arch/powerpc/platforms/powermac/pfunc_base.c +++ b/arch/powerpc/platforms/powermac/pfunc_base.c | |||
@@ -114,7 +114,7 @@ static void macio_gpio_init_one(struct macio_chip *macio) | |||
114 | * we just create them all | 114 | * we just create them all |
115 | */ | 115 | */ |
116 | for (gp = NULL; (gp = of_get_next_child(gparent, gp)) != NULL;) { | 116 | for (gp = NULL; (gp = of_get_next_child(gparent, gp)) != NULL;) { |
117 | const u32 *reg = get_property(gp, "reg", NULL); | 117 | const u32 *reg = of_get_property(gp, "reg", NULL); |
118 | unsigned long offset; | 118 | unsigned long offset; |
119 | if (reg == NULL) | 119 | if (reg == NULL) |
120 | continue; | 120 | continue; |
diff --git a/arch/powerpc/platforms/powermac/pfunc_core.c b/arch/powerpc/platforms/powermac/pfunc_core.c index a128553b8413..85434231ae14 100644 --- a/arch/powerpc/platforms/powermac/pfunc_core.c +++ b/arch/powerpc/platforms/powermac/pfunc_core.c | |||
@@ -820,7 +820,7 @@ struct pmf_function *__pmf_find_function(struct device_node *target, | |||
820 | * one, then we fallback to a direct call attempt | 820 | * one, then we fallback to a direct call attempt |
821 | */ | 821 | */ |
822 | snprintf(fname, 63, "platform-%s", name); | 822 | snprintf(fname, 63, "platform-%s", name); |
823 | prop = get_property(target, fname, NULL); | 823 | prop = of_get_property(target, fname, NULL); |
824 | if (prop == NULL) | 824 | if (prop == NULL) |
825 | goto find_it; | 825 | goto find_it; |
826 | ph = *prop; | 826 | ph = *prop; |
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c index 5e5c0e4add91..f59d311e25da 100644 --- a/arch/powerpc/platforms/powermac/pic.c +++ b/arch/powerpc/platforms/powermac/pic.c | |||
@@ -482,7 +482,7 @@ static struct mpic * __init pmac_setup_one_mpic(struct device_node *np, | |||
482 | pmac_call_feature(PMAC_FTR_ENABLE_MPIC, np, 0, 0); | 482 | pmac_call_feature(PMAC_FTR_ENABLE_MPIC, np, 0, 0); |
483 | 483 | ||
484 | flags |= MPIC_WANTS_RESET; | 484 | flags |= MPIC_WANTS_RESET; |
485 | if (get_property(np, "big-endian", NULL)) | 485 | if (of_get_property(np, "big-endian", NULL)) |
486 | flags |= MPIC_BIG_ENDIAN; | 486 | flags |= MPIC_BIG_ENDIAN; |
487 | 487 | ||
488 | /* Primary Big Endian means HT interrupts. This is quite dodgy | 488 | /* Primary Big Endian means HT interrupts. This is quite dodgy |
@@ -510,7 +510,7 @@ static int __init pmac_pic_probe_mpic(void) | |||
510 | for (np = NULL; (np = of_find_node_by_type(np, "open-pic")) | 510 | for (np = NULL; (np = of_find_node_by_type(np, "open-pic")) |
511 | != NULL;) { | 511 | != NULL;) { |
512 | if (master == NULL && | 512 | if (master == NULL && |
513 | get_property(np, "interrupts", NULL) == NULL) | 513 | of_get_property(np, "interrupts", NULL) == NULL) |
514 | master = of_node_get(np); | 514 | master = of_node_get(np); |
515 | else if (slave == NULL) | 515 | else if (slave == NULL) |
516 | slave = of_node_get(np); | 516 | slave = of_node_get(np); |
@@ -575,7 +575,7 @@ void __init pmac_pic_init(void) | |||
575 | #ifdef CONFIG_PPC32 | 575 | #ifdef CONFIG_PPC32 |
576 | if (!pmac_newworld) | 576 | if (!pmac_newworld) |
577 | flags |= OF_IMAP_OLDWORLD_MAC; | 577 | flags |= OF_IMAP_OLDWORLD_MAC; |
578 | if (get_property(of_chosen, "linux,bootx", NULL) != NULL) | 578 | if (of_get_property(of_chosen, "linux,bootx", NULL) != NULL) |
579 | flags |= OF_IMAP_NO_PHANDLE; | 579 | flags |= OF_IMAP_NO_PHANDLE; |
580 | #endif /* CONFIG_PPC_32 */ | 580 | #endif /* CONFIG_PPC_32 */ |
581 | 581 | ||
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c index f2a3063980eb..8c96f2461e9a 100644 --- a/arch/powerpc/platforms/powermac/setup.c +++ b/arch/powerpc/platforms/powermac/setup.c | |||
@@ -134,12 +134,12 @@ static void pmac_show_cpuinfo(struct seq_file *m) | |||
134 | seq_printf(m, "machine\t\t: "); | 134 | seq_printf(m, "machine\t\t: "); |
135 | np = of_find_node_by_path("/"); | 135 | np = of_find_node_by_path("/"); |
136 | if (np != NULL) { | 136 | if (np != NULL) { |
137 | pp = get_property(np, "model", NULL); | 137 | pp = of_get_property(np, "model", NULL); |
138 | if (pp != NULL) | 138 | if (pp != NULL) |
139 | seq_printf(m, "%s\n", pp); | 139 | seq_printf(m, "%s\n", pp); |
140 | else | 140 | else |
141 | seq_printf(m, "PowerMac\n"); | 141 | seq_printf(m, "PowerMac\n"); |
142 | pp = get_property(np, "compatible", &plen); | 142 | pp = of_get_property(np, "compatible", &plen); |
143 | if (pp != NULL) { | 143 | if (pp != NULL) { |
144 | seq_printf(m, "motherboard\t:"); | 144 | seq_printf(m, "motherboard\t:"); |
145 | while (plen > 0) { | 145 | while (plen > 0) { |
@@ -163,11 +163,13 @@ static void pmac_show_cpuinfo(struct seq_file *m) | |||
163 | if (np == NULL) | 163 | if (np == NULL) |
164 | np = of_find_node_by_type(NULL, "cache"); | 164 | np = of_find_node_by_type(NULL, "cache"); |
165 | if (np != NULL) { | 165 | if (np != NULL) { |
166 | const unsigned int *ic = get_property(np, "i-cache-size", NULL); | 166 | const unsigned int *ic = |
167 | const unsigned int *dc = get_property(np, "d-cache-size", NULL); | 167 | of_get_property(np, "i-cache-size", NULL); |
168 | const unsigned int *dc = | ||
169 | of_get_property(np, "d-cache-size", NULL); | ||
168 | seq_printf(m, "L2 cache\t:"); | 170 | seq_printf(m, "L2 cache\t:"); |
169 | has_l2cache = 1; | 171 | has_l2cache = 1; |
170 | if (get_property(np, "cache-unified", NULL) != 0 && dc) { | 172 | if (of_get_property(np, "cache-unified", NULL) != 0 && dc) { |
171 | seq_printf(m, " %dK unified", *dc / 1024); | 173 | seq_printf(m, " %dK unified", *dc / 1024); |
172 | } else { | 174 | } else { |
173 | if (ic) | 175 | if (ic) |
@@ -176,7 +178,7 @@ static void pmac_show_cpuinfo(struct seq_file *m) | |||
176 | seq_printf(m, "%s %dK data", | 178 | seq_printf(m, "%s %dK data", |
177 | (ic? " +": ""), *dc / 1024); | 179 | (ic? " +": ""), *dc / 1024); |
178 | } | 180 | } |
179 | pp = get_property(np, "ram-type", NULL); | 181 | pp = of_get_property(np, "ram-type", NULL); |
180 | if (pp) | 182 | if (pp) |
181 | seq_printf(m, " %s", pp); | 183 | seq_printf(m, " %s", pp); |
182 | seq_printf(m, "\n"); | 184 | seq_printf(m, "\n"); |
@@ -253,7 +255,7 @@ static void __init l2cr_init(void) | |||
253 | np = find_type_devices("cpu"); | 255 | np = find_type_devices("cpu"); |
254 | if (np != 0) { | 256 | if (np != 0) { |
255 | const unsigned int *l2cr = | 257 | const unsigned int *l2cr = |
256 | get_property(np, "l2cr-value", NULL); | 258 | of_get_property(np, "l2cr-value", NULL); |
257 | if (l2cr != 0) { | 259 | if (l2cr != 0) { |
258 | ppc_override_l2cr = 1; | 260 | ppc_override_l2cr = 1; |
259 | ppc_override_l2cr_value = *l2cr; | 261 | ppc_override_l2cr_value = *l2cr; |
@@ -285,7 +287,7 @@ static void __init pmac_setup_arch(void) | |||
285 | loops_per_jiffy = 50000000 / HZ; | 287 | loops_per_jiffy = 50000000 / HZ; |
286 | cpu = of_find_node_by_type(NULL, "cpu"); | 288 | cpu = of_find_node_by_type(NULL, "cpu"); |
287 | if (cpu != NULL) { | 289 | if (cpu != NULL) { |
288 | fp = get_property(cpu, "clock-frequency", NULL); | 290 | fp = of_get_property(cpu, "clock-frequency", NULL); |
289 | if (fp != NULL) { | 291 | if (fp != NULL) { |
290 | if (pvr >= 0x30 && pvr < 0x80) | 292 | if (pvr >= 0x30 && pvr < 0x80) |
291 | /* PPC970 etc. */ | 293 | /* PPC970 etc. */ |
@@ -302,7 +304,7 @@ static void __init pmac_setup_arch(void) | |||
302 | 304 | ||
303 | /* See if newworld or oldworld */ | 305 | /* See if newworld or oldworld */ |
304 | for (ic = NULL; (ic = of_find_all_nodes(ic)) != NULL; ) | 306 | for (ic = NULL; (ic = of_find_all_nodes(ic)) != NULL; ) |
305 | if (get_property(ic, "interrupt-controller", NULL)) | 307 | if (of_get_property(ic, "interrupt-controller", NULL)) |
306 | break; | 308 | break; |
307 | if (ic) { | 309 | if (ic) { |
308 | pmac_newworld = 1; | 310 | pmac_newworld = 1; |
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c index d73fb73802bb..20f328678fd1 100644 --- a/arch/powerpc/platforms/powermac/smp.c +++ b/arch/powerpc/platforms/powermac/smp.c | |||
@@ -567,7 +567,7 @@ static void __init smp_core99_setup_i2c_hwsync(int ncpus) | |||
567 | pmac_tb_clock_chip_host = pmac_i2c_find_bus(cc); | 567 | pmac_tb_clock_chip_host = pmac_i2c_find_bus(cc); |
568 | if (pmac_tb_clock_chip_host == NULL) | 568 | if (pmac_tb_clock_chip_host == NULL) |
569 | continue; | 569 | continue; |
570 | reg = get_property(cc, "reg", NULL); | 570 | reg = of_get_property(cc, "reg", NULL); |
571 | if (reg == NULL) | 571 | if (reg == NULL) |
572 | continue; | 572 | continue; |
573 | switch (*reg) { | 573 | switch (*reg) { |
@@ -695,7 +695,7 @@ static void __init smp_core99_setup(int ncpus) | |||
695 | struct device_node *cpus = | 695 | struct device_node *cpus = |
696 | of_find_node_by_path("/cpus"); | 696 | of_find_node_by_path("/cpus"); |
697 | if (cpus && | 697 | if (cpus && |
698 | get_property(cpus, "platform-cpu-timebase", NULL)) { | 698 | of_get_property(cpus, "platform-cpu-timebase", NULL)) { |
699 | pmac_tb_freeze = smp_core99_pfunc_tb_freeze; | 699 | pmac_tb_freeze = smp_core99_pfunc_tb_freeze; |
700 | printk(KERN_INFO "Processor timebase sync using" | 700 | printk(KERN_INFO "Processor timebase sync using" |
701 | " platform function\n"); | 701 | " platform function\n"); |
@@ -712,7 +712,7 @@ static void __init smp_core99_setup(int ncpus) | |||
712 | core99_tb_gpio = KL_GPIO_TB_ENABLE; /* default value */ | 712 | core99_tb_gpio = KL_GPIO_TB_ENABLE; /* default value */ |
713 | cpu = of_find_node_by_type(NULL, "cpu"); | 713 | cpu = of_find_node_by_type(NULL, "cpu"); |
714 | if (cpu != NULL) { | 714 | if (cpu != NULL) { |
715 | tbprop = get_property(cpu, "timebase-enable", NULL); | 715 | tbprop = of_get_property(cpu, "timebase-enable", NULL); |
716 | if (tbprop) | 716 | if (tbprop) |
717 | core99_tb_gpio = *tbprop; | 717 | core99_tb_gpio = *tbprop; |
718 | of_node_put(cpu); | 718 | of_node_put(cpu); |
diff --git a/arch/powerpc/platforms/powermac/udbg_scc.c b/arch/powerpc/platforms/powermac/udbg_scc.c index 379db05b0082..47de4d3fc167 100644 --- a/arch/powerpc/platforms/powermac/udbg_scc.c +++ b/arch/powerpc/platforms/powermac/udbg_scc.c | |||
@@ -81,7 +81,7 @@ void udbg_scc_init(int force_scc) | |||
81 | macio = of_get_parent(escc); | 81 | macio = of_get_parent(escc); |
82 | if (macio == NULL) | 82 | if (macio == NULL) |
83 | goto bail; | 83 | goto bail; |
84 | path = get_property(of_chosen, "linux,stdout-path", NULL); | 84 | path = of_get_property(of_chosen, "linux,stdout-path", NULL); |
85 | if (path != NULL) | 85 | if (path != NULL) |
86 | stdout = of_find_node_by_path(path); | 86 | stdout = of_find_node_by_path(path); |
87 | for (ch = NULL; (ch = of_get_next_child(escc, ch)) != NULL;) { | 87 | for (ch = NULL; (ch = of_get_next_child(escc, ch)) != NULL;) { |
@@ -96,13 +96,13 @@ void udbg_scc_init(int force_scc) | |||
96 | ch = ch_def ? ch_def : ch_a; | 96 | ch = ch_def ? ch_def : ch_a; |
97 | 97 | ||
98 | /* Get address within mac-io ASIC */ | 98 | /* Get address within mac-io ASIC */ |
99 | reg = get_property(escc, "reg", NULL); | 99 | reg = of_get_property(escc, "reg", NULL); |
100 | if (reg == NULL) | 100 | if (reg == NULL) |
101 | goto bail; | 101 | goto bail; |
102 | addr = reg[0]; | 102 | addr = reg[0]; |
103 | 103 | ||
104 | /* Get address of mac-io PCI itself */ | 104 | /* Get address of mac-io PCI itself */ |
105 | reg = get_property(macio, "assigned-addresses", NULL); | 105 | reg = of_get_property(macio, "assigned-addresses", NULL); |
106 | if (reg == NULL) | 106 | if (reg == NULL) |
107 | goto bail; | 107 | goto bail; |
108 | addr += reg[2]; | 108 | addr += reg[2]; |
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c index a56be71d1ede..48fbd442e9df 100644 --- a/arch/powerpc/platforms/pseries/eeh.c +++ b/arch/powerpc/platforms/pseries/eeh.c | |||
@@ -789,10 +789,10 @@ static void *early_enable_eeh(struct device_node *dn, void *data) | |||
789 | unsigned int rets[3]; | 789 | unsigned int rets[3]; |
790 | struct eeh_early_enable_info *info = data; | 790 | struct eeh_early_enable_info *info = data; |
791 | int ret; | 791 | int ret; |
792 | const char *status = get_property(dn, "status", NULL); | 792 | const char *status = of_get_property(dn, "status", NULL); |
793 | const u32 *class_code = get_property(dn, "class-code", NULL); | 793 | const u32 *class_code = of_get_property(dn, "class-code", NULL); |
794 | const u32 *vendor_id = get_property(dn, "vendor-id", NULL); | 794 | const u32 *vendor_id = of_get_property(dn, "vendor-id", NULL); |
795 | const u32 *device_id = get_property(dn, "device-id", NULL); | 795 | const u32 *device_id = of_get_property(dn, "device-id", NULL); |
796 | const u32 *regs; | 796 | const u32 *regs; |
797 | int enable; | 797 | int enable; |
798 | struct pci_dn *pdn = PCI_DN(dn); | 798 | struct pci_dn *pdn = PCI_DN(dn); |
@@ -835,7 +835,7 @@ static void *early_enable_eeh(struct device_node *dn, void *data) | |||
835 | 835 | ||
836 | /* Ok... see if this device supports EEH. Some do, some don't, | 836 | /* Ok... see if this device supports EEH. Some do, some don't, |
837 | * and the only way to find out is to check each and every one. */ | 837 | * and the only way to find out is to check each and every one. */ |
838 | regs = get_property(dn, "reg", NULL); | 838 | regs = of_get_property(dn, "reg", NULL); |
839 | if (regs) { | 839 | if (regs) { |
840 | /* First register entry is addr (00BBSS00) */ | 840 | /* First register entry is addr (00BBSS00) */ |
841 | /* Try to enable eeh */ | 841 | /* Try to enable eeh */ |
diff --git a/arch/powerpc/platforms/pseries/eeh_driver.c b/arch/powerpc/platforms/pseries/eeh_driver.c index 8cc331eecc9d..3170e003f76a 100644 --- a/arch/powerpc/platforms/pseries/eeh_driver.c +++ b/arch/powerpc/platforms/pseries/eeh_driver.c | |||
@@ -314,14 +314,14 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event) | |||
314 | 314 | ||
315 | if (!frozen_dn) { | 315 | if (!frozen_dn) { |
316 | 316 | ||
317 | location = get_property(event->dn, "ibm,loc-code", NULL); | 317 | location = of_get_property(event->dn, "ibm,loc-code", NULL); |
318 | location = location ? location : "unknown"; | 318 | location = location ? location : "unknown"; |
319 | printk(KERN_ERR "EEH: Error: Cannot find partition endpoint " | 319 | printk(KERN_ERR "EEH: Error: Cannot find partition endpoint " |
320 | "for location=%s pci addr=%s\n", | 320 | "for location=%s pci addr=%s\n", |
321 | location, pci_name(event->dev)); | 321 | location, pci_name(event->dev)); |
322 | return NULL; | 322 | return NULL; |
323 | } | 323 | } |
324 | location = get_property(frozen_dn, "ibm,loc-code", NULL); | 324 | location = of_get_property(frozen_dn, "ibm,loc-code", NULL); |
325 | location = location ? location : "unknown"; | 325 | location = location ? location : "unknown"; |
326 | 326 | ||
327 | /* There are two different styles for coming up with the PE. | 327 | /* There are two different styles for coming up with the PE. |
diff --git a/arch/powerpc/platforms/pseries/eeh_event.c b/arch/powerpc/platforms/pseries/eeh_event.c index 221dec8c16bd..ddb80f5d850b 100644 --- a/arch/powerpc/platforms/pseries/eeh_event.c +++ b/arch/powerpc/platforms/pseries/eeh_event.c | |||
@@ -126,7 +126,7 @@ int eeh_send_failure_event (struct device_node *dn, | |||
126 | 126 | ||
127 | if (!mem_init_done) { | 127 | if (!mem_init_done) { |
128 | printk(KERN_ERR "EEH: event during early boot not handled\n"); | 128 | printk(KERN_ERR "EEH: event during early boot not handled\n"); |
129 | location = get_property(dn, "ibm,loc-code", NULL); | 129 | location = of_get_property(dn, "ibm,loc-code", NULL); |
130 | printk(KERN_ERR "EEH: device node = %s\n", dn->full_name); | 130 | printk(KERN_ERR "EEH: device node = %s\n", dn->full_name); |
131 | printk(KERN_ERR "EEH: PCI location = %s\n", location); | 131 | printk(KERN_ERR "EEH: PCI location = %s\n", location); |
132 | return 1; | 132 | return 1; |
diff --git a/arch/powerpc/platforms/pseries/firmware.c b/arch/powerpc/platforms/pseries/firmware.c index 90522e3c9d46..29bf83bfb1f0 100644 --- a/arch/powerpc/platforms/pseries/firmware.c +++ b/arch/powerpc/platforms/pseries/firmware.c | |||
@@ -80,7 +80,7 @@ void __init fw_feature_init(void) | |||
80 | goto out; | 80 | goto out; |
81 | } | 81 | } |
82 | 82 | ||
83 | hypertas = get_property(dn, "ibm,hypertas-functions", &len); | 83 | hypertas = of_get_property(dn, "ibm,hypertas-functions", &len); |
84 | if (hypertas == NULL) | 84 | if (hypertas == NULL) |
85 | goto out; | 85 | goto out; |
86 | 86 | ||
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c index f460b9cbfd46..9711eb0d5496 100644 --- a/arch/powerpc/platforms/pseries/hotplug-cpu.c +++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c | |||
@@ -143,7 +143,7 @@ static int pseries_add_processor(struct device_node *np) | |||
143 | int err = -ENOSPC, len, nthreads, i; | 143 | int err = -ENOSPC, len, nthreads, i; |
144 | const u32 *intserv; | 144 | const u32 *intserv; |
145 | 145 | ||
146 | intserv = get_property(np, "ibm,ppc-interrupt-server#s", &len); | 146 | intserv = of_get_property(np, "ibm,ppc-interrupt-server#s", &len); |
147 | if (!intserv) | 147 | if (!intserv) |
148 | return 0; | 148 | return 0; |
149 | 149 | ||
@@ -203,7 +203,7 @@ static void pseries_remove_processor(struct device_node *np) | |||
203 | int len, nthreads, i; | 203 | int len, nthreads, i; |
204 | const u32 *intserv; | 204 | const u32 *intserv; |
205 | 205 | ||
206 | intserv = get_property(np, "ibm,ppc-interrupt-server#s", &len); | 206 | intserv = of_get_property(np, "ibm,ppc-interrupt-server#s", &len); |
207 | if (!intserv) | 207 | if (!intserv) |
208 | return; | 208 | return; |
209 | 209 | ||
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c index f9510a5a3e21..66665c82415c 100644 --- a/arch/powerpc/platforms/pseries/iommu.c +++ b/arch/powerpc/platforms/pseries/iommu.c | |||
@@ -253,8 +253,8 @@ static void iommu_table_setparms(struct pci_controller *phb, | |||
253 | 253 | ||
254 | node = (struct device_node *)phb->arch_data; | 254 | node = (struct device_node *)phb->arch_data; |
255 | 255 | ||
256 | basep = get_property(node, "linux,tce-base", NULL); | 256 | basep = of_get_property(node, "linux,tce-base", NULL); |
257 | sizep = get_property(node, "linux,tce-size", NULL); | 257 | sizep = of_get_property(node, "linux,tce-size", NULL); |
258 | if (basep == NULL || sizep == NULL) { | 258 | if (basep == NULL || sizep == NULL) { |
259 | printk(KERN_ERR "PCI_DMA: iommu_table_setparms: %s has " | 259 | printk(KERN_ERR "PCI_DMA: iommu_table_setparms: %s has " |
260 | "missing tce entries !\n", dn->full_name); | 260 | "missing tce entries !\n", dn->full_name); |
@@ -404,7 +404,7 @@ static void pci_dma_bus_setup_pSeriesLP(struct pci_bus *bus) | |||
404 | 404 | ||
405 | /* Find nearest ibm,dma-window, walking up the device tree */ | 405 | /* Find nearest ibm,dma-window, walking up the device tree */ |
406 | for (pdn = dn; pdn != NULL; pdn = pdn->parent) { | 406 | for (pdn = dn; pdn != NULL; pdn = pdn->parent) { |
407 | dma_window = get_property(pdn, "ibm,dma-window", NULL); | 407 | dma_window = of_get_property(pdn, "ibm,dma-window", NULL); |
408 | if (dma_window != NULL) | 408 | if (dma_window != NULL) |
409 | break; | 409 | break; |
410 | } | 410 | } |
@@ -499,7 +499,7 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev) | |||
499 | 499 | ||
500 | for (pdn = dn; pdn && PCI_DN(pdn) && !PCI_DN(pdn)->iommu_table; | 500 | for (pdn = dn; pdn && PCI_DN(pdn) && !PCI_DN(pdn)->iommu_table; |
501 | pdn = pdn->parent) { | 501 | pdn = pdn->parent) { |
502 | dma_window = get_property(pdn, "ibm,dma-window", NULL); | 502 | dma_window = of_get_property(pdn, "ibm,dma-window", NULL); |
503 | if (dma_window) | 503 | if (dma_window) |
504 | break; | 504 | break; |
505 | } | 505 | } |
@@ -548,7 +548,7 @@ static int iommu_reconfig_notifier(struct notifier_block *nb, unsigned long acti | |||
548 | switch (action) { | 548 | switch (action) { |
549 | case PSERIES_RECONFIG_REMOVE: | 549 | case PSERIES_RECONFIG_REMOVE: |
550 | if (pci && pci->iommu_table && | 550 | if (pci && pci->iommu_table && |
551 | get_property(np, "ibm,dma-window", NULL)) | 551 | of_get_property(np, "ibm,dma-window", NULL)) |
552 | iommu_free_table(np); | 552 | iommu_free_table(np); |
553 | break; | 553 | break; |
554 | default: | 554 | default: |
@@ -565,7 +565,7 @@ static struct notifier_block iommu_reconfig_nb = { | |||
565 | /* These are called very early. */ | 565 | /* These are called very early. */ |
566 | void iommu_init_early_pSeries(void) | 566 | void iommu_init_early_pSeries(void) |
567 | { | 567 | { |
568 | if (of_chosen && get_property(of_chosen, "linux,iommu-off", NULL)) { | 568 | if (of_chosen && of_get_property(of_chosen, "linux,iommu-off", NULL)) { |
569 | /* Direct I/O, IOMMU off */ | 569 | /* Direct I/O, IOMMU off */ |
570 | ppc_md.pci_dma_dev_setup = NULL; | 570 | ppc_md.pci_dma_dev_setup = NULL; |
571 | ppc_md.pci_dma_bus_setup = NULL; | 571 | ppc_md.pci_dma_bus_setup = NULL; |
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c index 843ee9643211..3a70e8ad7bc8 100644 --- a/arch/powerpc/platforms/pseries/lpar.c +++ b/arch/powerpc/platforms/pseries/lpar.c | |||
@@ -209,13 +209,13 @@ void __init find_udbg_vterm(void) | |||
209 | /* find the boot console from /chosen/stdout */ | 209 | /* find the boot console from /chosen/stdout */ |
210 | if (!of_chosen) | 210 | if (!of_chosen) |
211 | return; | 211 | return; |
212 | name = get_property(of_chosen, "linux,stdout-path", NULL); | 212 | name = of_get_property(of_chosen, "linux,stdout-path", NULL); |
213 | if (name == NULL) | 213 | if (name == NULL) |
214 | return; | 214 | return; |
215 | stdout_node = of_find_node_by_path(name); | 215 | stdout_node = of_find_node_by_path(name); |
216 | if (!stdout_node) | 216 | if (!stdout_node) |
217 | return; | 217 | return; |
218 | name = get_property(stdout_node, "name", NULL); | 218 | name = of_get_property(stdout_node, "name", NULL); |
219 | if (!name) { | 219 | if (!name) { |
220 | printk(KERN_WARNING "stdout node missing 'name' property!\n"); | 220 | printk(KERN_WARNING "stdout node missing 'name' property!\n"); |
221 | goto out; | 221 | goto out; |
@@ -226,7 +226,7 @@ void __init find_udbg_vterm(void) | |||
226 | /* Check if it's a virtual terminal */ | 226 | /* Check if it's a virtual terminal */ |
227 | if (strncmp(name, "vty", 3) != 0) | 227 | if (strncmp(name, "vty", 3) != 0) |
228 | goto out; | 228 | goto out; |
229 | termno = get_property(stdout_node, "reg", NULL); | 229 | termno = of_get_property(stdout_node, "reg", NULL); |
230 | if (termno == NULL) | 230 | if (termno == NULL) |
231 | goto out; | 231 | goto out; |
232 | vtermno = termno[0]; | 232 | vtermno = termno[0]; |
diff --git a/arch/powerpc/platforms/pseries/nvram.c b/arch/powerpc/platforms/pseries/nvram.c index 64163cecdf93..f68903e15bd5 100644 --- a/arch/powerpc/platforms/pseries/nvram.c +++ b/arch/powerpc/platforms/pseries/nvram.c | |||
@@ -130,7 +130,7 @@ int __init pSeries_nvram_init(void) | |||
130 | if (nvram == NULL) | 130 | if (nvram == NULL) |
131 | return -ENODEV; | 131 | return -ENODEV; |
132 | 132 | ||
133 | nbytes_p = get_property(nvram, "#bytes", &proplen); | 133 | nbytes_p = of_get_property(nvram, "#bytes", &proplen); |
134 | if (nbytes_p == NULL || proplen != sizeof(unsigned int)) | 134 | if (nbytes_p == NULL || proplen != sizeof(unsigned int)) |
135 | return -EIO; | 135 | return -EIO; |
136 | 136 | ||
diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c index 5c54ff9521c8..2c6ded29f73d 100644 --- a/arch/powerpc/platforms/pseries/pci.c +++ b/arch/powerpc/platforms/pseries/pci.c | |||
@@ -40,7 +40,7 @@ void pcibios_name_device(struct pci_dev *dev) | |||
40 | */ | 40 | */ |
41 | dn = pci_device_to_OF_node(dev); | 41 | dn = pci_device_to_OF_node(dev); |
42 | if (dn) { | 42 | if (dn) { |
43 | char *loc_code = get_property(dn, "ibm,loc-code", 0); | 43 | const char *loc_code = of_get_property(dn, "ibm,loc-code", 0); |
44 | if (loc_code) { | 44 | if (loc_code) { |
45 | int loc_len = strlen(loc_code); | 45 | int loc_len = strlen(loc_code); |
46 | if (loc_len < sizeof(dev->dev.name)) { | 46 | if (loc_len < sizeof(dev->dev.name)) { |
diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c index edc038873113..53aa04101ced 100644 --- a/arch/powerpc/platforms/pseries/ras.c +++ b/arch/powerpc/platforms/pseries/ras.c | |||
@@ -85,7 +85,7 @@ static void request_ras_irqs(struct device_node *np, | |||
85 | * map those interrupts using the default interrupt host and default | 85 | * map those interrupts using the default interrupt host and default |
86 | * trigger | 86 | * trigger |
87 | */ | 87 | */ |
88 | opicprop = get_property(np, "open-pic-interrupt", &opicplen); | 88 | opicprop = of_get_property(np, "open-pic-interrupt", &opicplen); |
89 | if (opicprop) { | 89 | if (opicprop) { |
90 | opicplen /= sizeof(u32); | 90 | opicplen /= sizeof(u32); |
91 | for (i = 0; i < opicplen; i++) { | 91 | for (i = 0; i < opicplen; i++) { |
diff --git a/arch/powerpc/platforms/pseries/rtasd.c b/arch/powerpc/platforms/pseries/rtasd.c index 77d0937d5c07..9797b10b2935 100644 --- a/arch/powerpc/platforms/pseries/rtasd.c +++ b/arch/powerpc/platforms/pseries/rtasd.c | |||
@@ -363,7 +363,7 @@ static int get_eventscan_parms(void) | |||
363 | 363 | ||
364 | node = of_find_node_by_path("/rtas"); | 364 | node = of_find_node_by_path("/rtas"); |
365 | 365 | ||
366 | ip = get_property(node, "rtas-event-scan-rate", NULL); | 366 | ip = of_get_property(node, "rtas-event-scan-rate", NULL); |
367 | if (ip == NULL) { | 367 | if (ip == NULL) { |
368 | printk(KERN_ERR "rtasd: no rtas-event-scan-rate\n"); | 368 | printk(KERN_ERR "rtasd: no rtas-event-scan-rate\n"); |
369 | of_node_put(node); | 369 | of_node_put(node); |
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index 54e93eb8a8ee..e2fcd2307e67 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -93,7 +93,7 @@ static void pSeries_show_cpuinfo(struct seq_file *m) | |||
93 | 93 | ||
94 | root = of_find_node_by_path("/"); | 94 | root = of_find_node_by_path("/"); |
95 | if (root) | 95 | if (root) |
96 | model = get_property(root, "model", NULL); | 96 | model = of_get_property(root, "model", NULL); |
97 | seq_printf(m, "machine\t\t: CHRP %s\n", model); | 97 | seq_printf(m, "machine\t\t: CHRP %s\n", model); |
98 | of_node_put(root); | 98 | of_node_put(root); |
99 | } | 99 | } |
@@ -140,7 +140,7 @@ static void __init pseries_mpic_init_IRQ(void) | |||
140 | 140 | ||
141 | np = of_find_node_by_path("/"); | 141 | np = of_find_node_by_path("/"); |
142 | naddr = of_n_addr_cells(np); | 142 | naddr = of_n_addr_cells(np); |
143 | opprop = get_property(np, "platform-open-pic", &opplen); | 143 | opprop = of_get_property(np, "platform-open-pic", &opplen); |
144 | if (opprop != 0) { | 144 | if (opprop != 0) { |
145 | openpic_addr = of_read_number(opprop, naddr); | 145 | openpic_addr = of_read_number(opprop, naddr); |
146 | printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr); | 146 | printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr); |
@@ -189,7 +189,7 @@ static void __init pseries_mpic_init_IRQ(void) | |||
189 | break; | 189 | break; |
190 | if (strcmp(np->name, "pci") != 0) | 190 | if (strcmp(np->name, "pci") != 0) |
191 | continue; | 191 | continue; |
192 | addrp = get_property(np, "8259-interrupt-acknowledge", | 192 | addrp = of_get_property(np, "8259-interrupt-acknowledge", |
193 | NULL); | 193 | NULL); |
194 | if (addrp == NULL) | 194 | if (addrp == NULL) |
195 | continue; | 195 | continue; |
@@ -226,7 +226,7 @@ static void __init pseries_discover_pic(void) | |||
226 | 226 | ||
227 | for (np = NULL; (np = of_find_node_by_name(np, | 227 | for (np = NULL; (np = of_find_node_by_name(np, |
228 | "interrupt-controller"));) { | 228 | "interrupt-controller"));) { |
229 | typep = get_property(np, "compatible", NULL); | 229 | typep = of_get_property(np, "compatible", NULL); |
230 | if (strstr(typep, "open-pic")) { | 230 | if (strstr(typep, "open-pic")) { |
231 | pSeries_mpic_node = of_node_get(np); | 231 | pSeries_mpic_node = of_node_get(np); |
232 | ppc_md.init_IRQ = pseries_mpic_init_IRQ; | 232 | ppc_md.init_IRQ = pseries_mpic_init_IRQ; |
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c index f0795faada91..896cbf340c42 100644 --- a/arch/powerpc/platforms/pseries/xics.c +++ b/arch/powerpc/platforms/pseries/xics.c | |||
@@ -576,7 +576,7 @@ static void __init xics_init_one_node(struct device_node *np, | |||
576 | * This happens to be the case so far but we are playing with fire... | 576 | * This happens to be the case so far but we are playing with fire... |
577 | * should be fixed one of these days. -BenH. | 577 | * should be fixed one of these days. -BenH. |
578 | */ | 578 | */ |
579 | ireg = get_property(np, "ibm,interrupt-server-ranges", NULL); | 579 | ireg = of_get_property(np, "ibm,interrupt-server-ranges", NULL); |
580 | 580 | ||
581 | /* Do that ever happen ? we'll know soon enough... but even good'old | 581 | /* Do that ever happen ? we'll know soon enough... but even good'old |
582 | * f80 does have that property .. | 582 | * f80 does have that property .. |
@@ -588,7 +588,7 @@ static void __init xics_init_one_node(struct device_node *np, | |||
588 | */ | 588 | */ |
589 | *indx = *ireg; | 589 | *indx = *ireg; |
590 | } | 590 | } |
591 | ireg = get_property(np, "reg", &ilen); | 591 | ireg = of_get_property(np, "reg", &ilen); |
592 | if (!ireg) | 592 | if (!ireg) |
593 | panic("xics_init_IRQ: can't find interrupt reg property"); | 593 | panic("xics_init_IRQ: can't find interrupt reg property"); |
594 | 594 | ||
@@ -640,7 +640,7 @@ static void __init xics_setup_8259_cascade(void) | |||
640 | break; | 640 | break; |
641 | if (strcmp(np->name, "pci") != 0) | 641 | if (strcmp(np->name, "pci") != 0) |
642 | continue; | 642 | continue; |
643 | addrp = get_property(np, "8259-interrupt-acknowledge", NULL); | 643 | addrp = of_get_property(np, "8259-interrupt-acknowledge", NULL); |
644 | if (addrp == NULL) | 644 | if (addrp == NULL) |
645 | continue; | 645 | continue; |
646 | naddr = of_n_addr_cells(np); | 646 | naddr = of_n_addr_cells(np); |
@@ -664,10 +664,11 @@ static struct device_node *cpuid_to_of_node(int cpu) | |||
664 | int i, len; | 664 | int i, len; |
665 | const u32 *intserv; | 665 | const u32 *intserv; |
666 | 666 | ||
667 | intserv = get_property(np, "ibm,ppc-interrupt-server#s", &len); | 667 | intserv = of_get_property(np, "ibm,ppc-interrupt-server#s", |
668 | &len); | ||
668 | 669 | ||
669 | if (!intserv) | 670 | if (!intserv) |
670 | intserv = get_property(np, "reg", &len); | 671 | intserv = of_get_property(np, "reg", &len); |
671 | 672 | ||
672 | i = len / sizeof(u32); | 673 | i = len / sizeof(u32); |
673 | 674 | ||
@@ -709,7 +710,7 @@ void __init xics_init_IRQ(void) | |||
709 | /* Find the server numbers for the boot cpu. */ | 710 | /* Find the server numbers for the boot cpu. */ |
710 | np = cpuid_to_of_node(boot_cpuid); | 711 | np = cpuid_to_of_node(boot_cpuid); |
711 | BUG_ON(!np); | 712 | BUG_ON(!np); |
712 | ireg = get_property(np, "ibm,ppc-interrupt-gserver#s", &ilen); | 713 | ireg = of_get_property(np, "ibm,ppc-interrupt-gserver#s", &ilen); |
713 | if (!ireg) | 714 | if (!ireg) |
714 | goto skip_gserver_check; | 715 | goto skip_gserver_check; |
715 | i = ilen / sizeof(int); | 716 | i = ilen / sizeof(int); |
@@ -725,7 +726,7 @@ void __init xics_init_IRQ(void) | |||
725 | default_server = hcpuid; | 726 | default_server = hcpuid; |
726 | default_distrib_server = ireg[j+1]; | 727 | default_distrib_server = ireg[j+1]; |
727 | 728 | ||
728 | isize = get_property(np, | 729 | isize = of_get_property(np, |
729 | "ibm,interrupt-server#-size", NULL); | 730 | "ibm,interrupt-server#-size", NULL); |
730 | if (isize) | 731 | if (isize) |
731 | interrupt_server_size = *isize; | 732 | interrupt_server_size = *isize; |
diff --git a/arch/powerpc/sysdev/dcr.c b/arch/powerpc/sysdev/dcr.c index 1fc5819e7d18..574b6ef44e0b 100644 --- a/arch/powerpc/sysdev/dcr.c +++ b/arch/powerpc/sysdev/dcr.c | |||
@@ -26,7 +26,7 @@ | |||
26 | unsigned int dcr_resource_start(struct device_node *np, unsigned int index) | 26 | unsigned int dcr_resource_start(struct device_node *np, unsigned int index) |
27 | { | 27 | { |
28 | unsigned int ds; | 28 | unsigned int ds; |
29 | const u32 *dr = get_property(np, "dcr-reg", &ds); | 29 | const u32 *dr = of_get_property(np, "dcr-reg", &ds); |
30 | 30 | ||
31 | if (dr == NULL || ds & 1 || index >= (ds / 8)) | 31 | if (dr == NULL || ds & 1 || index >= (ds / 8)) |
32 | return 0; | 32 | return 0; |
@@ -37,7 +37,7 @@ unsigned int dcr_resource_start(struct device_node *np, unsigned int index) | |||
37 | unsigned int dcr_resource_len(struct device_node *np, unsigned int index) | 37 | unsigned int dcr_resource_len(struct device_node *np, unsigned int index) |
38 | { | 38 | { |
39 | unsigned int ds; | 39 | unsigned int ds; |
40 | const u32 *dr = get_property(np, "dcr-reg", &ds); | 40 | const u32 *dr = of_get_property(np, "dcr-reg", &ds); |
41 | 41 | ||
42 | if (dr == NULL || ds & 1 || index >= (ds / 8)) | 42 | if (dr == NULL || ds & 1 || index >= (ds / 8)) |
43 | return 0; | 43 | return 0; |
@@ -53,9 +53,9 @@ static struct device_node * find_dcr_parent(struct device_node * node) | |||
53 | const u32 *p; | 53 | const u32 *p; |
54 | 54 | ||
55 | for (par = of_node_get(node); par;) { | 55 | for (par = of_node_get(node); par;) { |
56 | if (get_property(par, "dcr-controller", NULL)) | 56 | if (of_get_property(par, "dcr-controller", NULL)) |
57 | break; | 57 | break; |
58 | p = get_property(par, "dcr-parent", NULL); | 58 | p = of_get_property(par, "dcr-parent", NULL); |
59 | tmp = par; | 59 | tmp = par; |
60 | if (p == NULL) | 60 | if (p == NULL) |
61 | par = of_get_parent(par); | 61 | par = of_get_parent(par); |
@@ -80,13 +80,13 @@ u64 of_translate_dcr_address(struct device_node *dev, | |||
80 | return OF_BAD_ADDR; | 80 | return OF_BAD_ADDR; |
81 | 81 | ||
82 | /* Stride is not properly defined yet, default to 0x10 for Axon */ | 82 | /* Stride is not properly defined yet, default to 0x10 for Axon */ |
83 | p = get_property(dp, "dcr-mmio-stride", NULL); | 83 | p = of_get_property(dp, "dcr-mmio-stride", NULL); |
84 | stride = (p == NULL) ? 0x10 : *p; | 84 | stride = (p == NULL) ? 0x10 : *p; |
85 | 85 | ||
86 | /* XXX FIXME: Which property name is to use of the 2 following ? */ | 86 | /* XXX FIXME: Which property name is to use of the 2 following ? */ |
87 | p = get_property(dp, "dcr-mmio-range", NULL); | 87 | p = of_get_property(dp, "dcr-mmio-range", NULL); |
88 | if (p == NULL) | 88 | if (p == NULL) |
89 | p = get_property(dp, "dcr-mmio-space", NULL); | 89 | p = of_get_property(dp, "dcr-mmio-space", NULL); |
90 | if (p == NULL) | 90 | if (p == NULL) |
91 | return OF_BAD_ADDR; | 91 | return OF_BAD_ADDR; |
92 | 92 | ||
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c index d20f02927f72..8a123c71449f 100644 --- a/arch/powerpc/sysdev/fsl_soc.c +++ b/arch/powerpc/sysdev/fsl_soc.c | |||
@@ -52,7 +52,7 @@ phys_addr_t get_immrbase(void) | |||
52 | soc = of_find_node_by_type(NULL, "soc"); | 52 | soc = of_find_node_by_type(NULL, "soc"); |
53 | if (soc) { | 53 | if (soc) { |
54 | unsigned int size; | 54 | unsigned int size; |
55 | const void *prop = get_property(soc, "reg", &size); | 55 | const void *prop = of_get_property(soc, "reg", &size); |
56 | 56 | ||
57 | if (prop) | 57 | if (prop) |
58 | immrbase = of_translate_address(soc, prop); | 58 | immrbase = of_translate_address(soc, prop); |
@@ -78,8 +78,8 @@ u32 get_brgfreq(void) | |||
78 | node = of_find_node_by_type(NULL, "cpm"); | 78 | node = of_find_node_by_type(NULL, "cpm"); |
79 | if (node) { | 79 | if (node) { |
80 | unsigned int size; | 80 | unsigned int size; |
81 | const unsigned int *prop = get_property(node, "brg-frequency", | 81 | const unsigned int *prop = of_get_property(node, |
82 | &size); | 82 | "brg-frequency", &size); |
83 | 83 | ||
84 | if (prop) | 84 | if (prop) |
85 | brgfreq = *prop; | 85 | brgfreq = *prop; |
@@ -103,8 +103,8 @@ u32 get_baudrate(void) | |||
103 | node = of_find_node_by_type(NULL, "serial"); | 103 | node = of_find_node_by_type(NULL, "serial"); |
104 | if (node) { | 104 | if (node) { |
105 | unsigned int size; | 105 | unsigned int size; |
106 | const unsigned int *prop = get_property(node, "current-speed", | 106 | const unsigned int *prop = of_get_property(node, |
107 | &size); | 107 | "current-speed", &size); |
108 | 108 | ||
109 | if (prop) | 109 | if (prop) |
110 | fs_baudrate = *prop; | 110 | fs_baudrate = *prop; |
@@ -153,7 +153,8 @@ static int __init gfar_mdio_of_init(void) | |||
153 | while ((child = of_get_next_child(np, child)) != NULL) { | 153 | while ((child = of_get_next_child(np, child)) != NULL) { |
154 | int irq = irq_of_parse_and_map(child, 0); | 154 | int irq = irq_of_parse_and_map(child, 0); |
155 | if (irq != NO_IRQ) { | 155 | if (irq != NO_IRQ) { |
156 | const u32 *id = get_property(child, "reg", NULL); | 156 | const u32 *id = of_get_property(child, |
157 | "reg", NULL); | ||
157 | mdio_data.irq[*id] = irq; | 158 | mdio_data.irq[*id] = irq; |
158 | } | 159 | } |
159 | } | 160 | } |
@@ -209,7 +210,7 @@ static int __init gfar_of_init(void) | |||
209 | 210 | ||
210 | of_irq_to_resource(np, 0, &r[1]); | 211 | of_irq_to_resource(np, 0, &r[1]); |
211 | 212 | ||
212 | model = get_property(np, "model", NULL); | 213 | model = of_get_property(np, "model", NULL); |
213 | 214 | ||
214 | /* If we aren't the FEC we have multiple interrupts */ | 215 | /* If we aren't the FEC we have multiple interrupts */ |
215 | if (model && strcasecmp(model, "FEC")) { | 216 | if (model && strcasecmp(model, "FEC")) { |
@@ -253,7 +254,7 @@ static int __init gfar_of_init(void) | |||
253 | FSL_GIANFAR_DEV_HAS_VLAN | | 254 | FSL_GIANFAR_DEV_HAS_VLAN | |
254 | FSL_GIANFAR_DEV_HAS_EXTENDED_HASH; | 255 | FSL_GIANFAR_DEV_HAS_EXTENDED_HASH; |
255 | 256 | ||
256 | ph = get_property(np, "phy-handle", NULL); | 257 | ph = of_get_property(np, "phy-handle", NULL); |
257 | phy = of_find_node_by_phandle(*ph); | 258 | phy = of_find_node_by_phandle(*ph); |
258 | 259 | ||
259 | if (phy == NULL) { | 260 | if (phy == NULL) { |
@@ -263,7 +264,7 @@ static int __init gfar_of_init(void) | |||
263 | 264 | ||
264 | mdio = of_get_parent(phy); | 265 | mdio = of_get_parent(phy); |
265 | 266 | ||
266 | id = get_property(phy, "reg", NULL); | 267 | id = of_get_property(phy, "reg", NULL); |
267 | ret = of_address_to_resource(mdio, 0, &res); | 268 | ret = of_address_to_resource(mdio, 0, &res); |
268 | if (ret) { | 269 | if (ret) { |
269 | of_node_put(phy); | 270 | of_node_put(phy); |
@@ -325,11 +326,11 @@ static int __init fsl_i2c_of_init(void) | |||
325 | } | 326 | } |
326 | 327 | ||
327 | i2c_data.device_flags = 0; | 328 | i2c_data.device_flags = 0; |
328 | flags = get_property(np, "dfsrr", NULL); | 329 | flags = of_get_property(np, "dfsrr", NULL); |
329 | if (flags) | 330 | if (flags) |
330 | i2c_data.device_flags |= FSL_I2C_DEV_SEPARATE_DFSRR; | 331 | i2c_data.device_flags |= FSL_I2C_DEV_SEPARATE_DFSRR; |
331 | 332 | ||
332 | flags = get_property(np, "fsl5200-clocking", NULL); | 333 | flags = of_get_property(np, "fsl5200-clocking", NULL); |
333 | if (flags) | 334 | if (flags) |
334 | i2c_data.device_flags |= FSL_I2C_DEV_CLOCK_5200; | 335 | i2c_data.device_flags |= FSL_I2C_DEV_CLOCK_5200; |
335 | 336 | ||
@@ -374,7 +375,7 @@ static int __init mpc83xx_wdt_init(void) | |||
374 | goto nosoc; | 375 | goto nosoc; |
375 | } | 376 | } |
376 | 377 | ||
377 | freq = get_property(soc, "bus-frequency", NULL); | 378 | freq = of_get_property(soc, "bus-frequency", NULL); |
378 | if (!freq) { | 379 | if (!freq) { |
379 | ret = -ENODEV; | 380 | ret = -ENODEV; |
380 | goto err; | 381 | goto err; |
@@ -466,15 +467,15 @@ static int __init fsl_usb_of_init(void) | |||
466 | 467 | ||
467 | usb_data.operating_mode = FSL_USB2_MPH_HOST; | 468 | usb_data.operating_mode = FSL_USB2_MPH_HOST; |
468 | 469 | ||
469 | prop = get_property(np, "port0", NULL); | 470 | prop = of_get_property(np, "port0", NULL); |
470 | if (prop) | 471 | if (prop) |
471 | usb_data.port_enables |= FSL_USB2_PORT0_ENABLED; | 472 | usb_data.port_enables |= FSL_USB2_PORT0_ENABLED; |
472 | 473 | ||
473 | prop = get_property(np, "port1", NULL); | 474 | prop = of_get_property(np, "port1", NULL); |
474 | if (prop) | 475 | if (prop) |
475 | usb_data.port_enables |= FSL_USB2_PORT1_ENABLED; | 476 | usb_data.port_enables |= FSL_USB2_PORT1_ENABLED; |
476 | 477 | ||
477 | prop = get_property(np, "phy_type", NULL); | 478 | prop = of_get_property(np, "phy_type", NULL); |
478 | usb_data.phy_mode = determine_usb_phy(prop); | 479 | usb_data.phy_mode = determine_usb_phy(prop); |
479 | 480 | ||
480 | ret = | 481 | ret = |
@@ -501,7 +502,7 @@ static int __init fsl_usb_of_init(void) | |||
501 | 502 | ||
502 | of_irq_to_resource(np, 0, &r[1]); | 503 | of_irq_to_resource(np, 0, &r[1]); |
503 | 504 | ||
504 | prop = get_property(np, "dr_mode", NULL); | 505 | prop = of_get_property(np, "dr_mode", NULL); |
505 | 506 | ||
506 | if (!prop || !strcmp(prop, "host")) { | 507 | if (!prop || !strcmp(prop, "host")) { |
507 | usb_data.operating_mode = FSL_USB2_DR_HOST; | 508 | usb_data.operating_mode = FSL_USB2_DR_HOST; |
@@ -538,7 +539,7 @@ static int __init fsl_usb_of_init(void) | |||
538 | goto err; | 539 | goto err; |
539 | } | 540 | } |
540 | 541 | ||
541 | prop = get_property(np, "phy_type", NULL); | 542 | prop = of_get_property(np, "phy_type", NULL); |
542 | usb_data.phy_mode = determine_usb_phy(prop); | 543 | usb_data.phy_mode = determine_usb_phy(prop); |
543 | 544 | ||
544 | if (usb_dev_dr_host) { | 545 | if (usb_dev_dr_host) { |
@@ -633,7 +634,7 @@ static int __init fs_enet_of_init(void) | |||
633 | goto err; | 634 | goto err; |
634 | } | 635 | } |
635 | 636 | ||
636 | model = get_property(np, "model", NULL); | 637 | model = of_get_property(np, "model", NULL); |
637 | if (model == NULL) { | 638 | if (model == NULL) { |
638 | ret = -ENODEV; | 639 | ret = -ENODEV; |
639 | goto unreg; | 640 | goto unreg; |
@@ -643,7 +644,7 @@ static int __init fs_enet_of_init(void) | |||
643 | if (mac_addr) | 644 | if (mac_addr) |
644 | memcpy(fs_enet_data.macaddr, mac_addr, 6); | 645 | memcpy(fs_enet_data.macaddr, mac_addr, 6); |
645 | 646 | ||
646 | ph = get_property(np, "phy-handle", NULL); | 647 | ph = of_get_property(np, "phy-handle", NULL); |
647 | phy = of_find_node_by_phandle(*ph); | 648 | phy = of_find_node_by_phandle(*ph); |
648 | 649 | ||
649 | if (phy == NULL) { | 650 | if (phy == NULL) { |
@@ -651,12 +652,12 @@ static int __init fs_enet_of_init(void) | |||
651 | goto unreg; | 652 | goto unreg; |
652 | } | 653 | } |
653 | 654 | ||
654 | phy_addr = get_property(phy, "reg", NULL); | 655 | phy_addr = of_get_property(phy, "reg", NULL); |
655 | fs_enet_data.phy_addr = *phy_addr; | 656 | fs_enet_data.phy_addr = *phy_addr; |
656 | 657 | ||
657 | phy_irq = get_property(phy, "interrupts", NULL); | 658 | phy_irq = of_get_property(phy, "interrupts", NULL); |
658 | 659 | ||
659 | id = get_property(np, "device-id", NULL); | 660 | id = of_get_property(np, "device-id", NULL); |
660 | fs_enet_data.fs_no = *id; | 661 | fs_enet_data.fs_no = *id; |
661 | strcpy(fs_enet_data.fs_type, model); | 662 | strcpy(fs_enet_data.fs_type, model); |
662 | 663 | ||
@@ -668,8 +669,10 @@ static int __init fs_enet_of_init(void) | |||
668 | goto unreg; | 669 | goto unreg; |
669 | } | 670 | } |
670 | 671 | ||
671 | fs_enet_data.clk_rx = *((u32 *) get_property(np, "rx-clock", NULL)); | 672 | fs_enet_data.clk_rx = *((u32 *)of_get_property(np, |
672 | fs_enet_data.clk_tx = *((u32 *) get_property(np, "tx-clock", NULL)); | 673 | "rx-clock", NULL)); |
674 | fs_enet_data.clk_tx = *((u32 *)of_get_property(np, | ||
675 | "tx-clock", NULL)); | ||
673 | 676 | ||
674 | if (strstr(model, "FCC")) { | 677 | if (strstr(model, "FCC")) { |
675 | int fcc_index = *id - 1; | 678 | int fcc_index = *id - 1; |
@@ -690,7 +693,7 @@ static int __init fs_enet_of_init(void) | |||
690 | fs_enet_data.bus_id = (char*)&bus_id[(*id)]; | 693 | fs_enet_data.bus_id = (char*)&bus_id[(*id)]; |
691 | fs_enet_data.init_ioports = init_fcc_ioports; | 694 | fs_enet_data.init_ioports = init_fcc_ioports; |
692 | 695 | ||
693 | mdio_bb_prop = get_property(phy, "bitbang", NULL); | 696 | mdio_bb_prop = of_get_property(phy, "bitbang", NULL); |
694 | if (mdio_bb_prop) { | 697 | if (mdio_bb_prop) { |
695 | struct platform_device *fs_enet_mdio_bb_dev; | 698 | struct platform_device *fs_enet_mdio_bb_dev; |
696 | struct fs_mii_bb_platform_info fs_enet_mdio_bb_data; | 699 | struct fs_mii_bb_platform_info fs_enet_mdio_bb_data; |
@@ -796,10 +799,10 @@ static int __init cpm_uart_of_init(void) | |||
796 | goto err; | 799 | goto err; |
797 | } | 800 | } |
798 | 801 | ||
799 | id = get_property(np, "device-id", NULL); | 802 | id = of_get_property(np, "device-id", NULL); |
800 | cpm_uart_data.fs_no = *id; | 803 | cpm_uart_data.fs_no = *id; |
801 | 804 | ||
802 | model = (char*)get_property(np, "model", NULL); | 805 | model = of_get_property(np, "model", NULL); |
803 | strcpy(cpm_uart_data.fs_type, model); | 806 | strcpy(cpm_uart_data.fs_type, model); |
804 | 807 | ||
805 | cpm_uart_data.uart_clk = ppc_proc_freq; | 808 | cpm_uart_data.uart_clk = ppc_proc_freq; |
@@ -808,8 +811,10 @@ static int __init cpm_uart_of_init(void) | |||
808 | cpm_uart_data.tx_buf_size = 32; | 811 | cpm_uart_data.tx_buf_size = 32; |
809 | cpm_uart_data.rx_num_fifo = 4; | 812 | cpm_uart_data.rx_num_fifo = 4; |
810 | cpm_uart_data.rx_buf_size = 32; | 813 | cpm_uart_data.rx_buf_size = 32; |
811 | cpm_uart_data.clk_rx = *((u32 *) get_property(np, "rx-clock", NULL)); | 814 | cpm_uart_data.clk_rx = *((u32 *)of_get_property(np, |
812 | cpm_uart_data.clk_tx = *((u32 *) get_property(np, "tx-clock", NULL)); | 815 | "rx-clock", NULL)); |
816 | cpm_uart_data.clk_tx = *((u32 *)of_get_property(np, | ||
817 | "tx-clock", NULL)); | ||
813 | 818 | ||
814 | ret = | 819 | ret = |
815 | platform_device_add_data(cpm_uart_dev, &cpm_uart_data, | 820 | platform_device_add_data(cpm_uart_dev, &cpm_uart_data, |
@@ -833,7 +838,7 @@ arch_initcall(cpm_uart_of_init); | |||
833 | #ifdef CONFIG_8xx | 838 | #ifdef CONFIG_8xx |
834 | 839 | ||
835 | extern void init_scc_ioports(struct fs_platform_info*); | 840 | extern void init_scc_ioports(struct fs_platform_info*); |
836 | extern int platform_device_skip(char *model, int id); | 841 | extern int platform_device_skip(const char *model, int id); |
837 | 842 | ||
838 | static int __init fs_enet_mdio_of_init(void) | 843 | static int __init fs_enet_mdio_of_init(void) |
839 | { | 844 | { |
@@ -900,21 +905,22 @@ static int __init fs_enet_of_init(void) | |||
900 | struct resource r[4]; | 905 | struct resource r[4]; |
901 | struct device_node *phy = NULL, *mdio = NULL; | 906 | struct device_node *phy = NULL, *mdio = NULL; |
902 | struct fs_platform_info fs_enet_data; | 907 | struct fs_platform_info fs_enet_data; |
903 | unsigned int *id, *phy_addr; | 908 | const unsigned int *id; |
909 | const unsigned int *phy_addr; | ||
904 | void *mac_addr; | 910 | void *mac_addr; |
905 | phandle *ph; | 911 | const phandle *ph; |
906 | char *model; | 912 | const char *model; |
907 | 913 | ||
908 | memset(r, 0, sizeof(r)); | 914 | memset(r, 0, sizeof(r)); |
909 | memset(&fs_enet_data, 0, sizeof(fs_enet_data)); | 915 | memset(&fs_enet_data, 0, sizeof(fs_enet_data)); |
910 | 916 | ||
911 | model = (char *)get_property(np, "model", NULL); | 917 | model = of_get_property(np, "model", NULL); |
912 | if (model == NULL) { | 918 | if (model == NULL) { |
913 | ret = -ENODEV; | 919 | ret = -ENODEV; |
914 | goto unreg; | 920 | goto unreg; |
915 | } | 921 | } |
916 | 922 | ||
917 | id = (u32 *) get_property(np, "device-id", NULL); | 923 | id = of_get_property(np, "device-id", NULL); |
918 | fs_enet_data.fs_no = *id; | 924 | fs_enet_data.fs_no = *id; |
919 | 925 | ||
920 | if (platform_device_skip(model, *id)) | 926 | if (platform_device_skip(model, *id)) |
@@ -929,12 +935,12 @@ static int __init fs_enet_of_init(void) | |||
929 | if (mac_addr) | 935 | if (mac_addr) |
930 | memcpy(fs_enet_data.macaddr, mac_addr, 6); | 936 | memcpy(fs_enet_data.macaddr, mac_addr, 6); |
931 | 937 | ||
932 | ph = (phandle *) get_property(np, "phy-handle", NULL); | 938 | ph = of_get_property(np, "phy-handle", NULL); |
933 | if (ph != NULL) | 939 | if (ph != NULL) |
934 | phy = of_find_node_by_phandle(*ph); | 940 | phy = of_find_node_by_phandle(*ph); |
935 | 941 | ||
936 | if (phy != NULL) { | 942 | if (phy != NULL) { |
937 | phy_addr = (u32 *) get_property(phy, "reg", NULL); | 943 | phy_addr = of_get_property(phy, "reg", NULL); |
938 | fs_enet_data.phy_addr = *phy_addr; | 944 | fs_enet_data.phy_addr = *phy_addr; |
939 | fs_enet_data.has_phy = 1; | 945 | fs_enet_data.has_phy = 1; |
940 | 946 | ||
@@ -947,7 +953,7 @@ static int __init fs_enet_of_init(void) | |||
947 | } | 953 | } |
948 | } | 954 | } |
949 | 955 | ||
950 | model = (char*)get_property(np, "model", NULL); | 956 | model = of_get_property(np, "model", NULL); |
951 | strcpy(fs_enet_data.fs_type, model); | 957 | strcpy(fs_enet_data.fs_type, model); |
952 | 958 | ||
953 | if (strstr(model, "FEC")) { | 959 | if (strstr(model, "FEC")) { |
@@ -1038,8 +1044,8 @@ static int __init cpm_smc_uart_of_init(void) | |||
1038 | i++) { | 1044 | i++) { |
1039 | struct resource r[3]; | 1045 | struct resource r[3]; |
1040 | struct fs_uart_platform_info cpm_uart_data; | 1046 | struct fs_uart_platform_info cpm_uart_data; |
1041 | int *id; | 1047 | const int *id; |
1042 | char *model; | 1048 | const char *model; |
1043 | 1049 | ||
1044 | memset(r, 0, sizeof(r)); | 1050 | memset(r, 0, sizeof(r)); |
1045 | memset(&cpm_uart_data, 0, sizeof(cpm_uart_data)); | 1051 | memset(&cpm_uart_data, 0, sizeof(cpm_uart_data)); |
@@ -1066,10 +1072,10 @@ static int __init cpm_smc_uart_of_init(void) | |||
1066 | goto err; | 1072 | goto err; |
1067 | } | 1073 | } |
1068 | 1074 | ||
1069 | model = (char*)get_property(np, "model", NULL); | 1075 | model = of_get_property(np, "model", NULL); |
1070 | strcpy(cpm_uart_data.fs_type, model); | 1076 | strcpy(cpm_uart_data.fs_type, model); |
1071 | 1077 | ||
1072 | id = (int*)get_property(np, "device-id", NULL); | 1078 | id = of_get_property(np, "device-id", NULL); |
1073 | cpm_uart_data.fs_no = *id; | 1079 | cpm_uart_data.fs_no = *id; |
1074 | cpm_uart_data.uart_clk = ppc_proc_freq; | 1080 | cpm_uart_data.uart_clk = ppc_proc_freq; |
1075 | 1081 | ||
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index bcfb900481f8..27e6f78739eb 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
@@ -970,7 +970,7 @@ struct mpic * __init mpic_alloc(struct device_node *node, | |||
970 | mpic->spurious_vec = intvec_top; | 970 | mpic->spurious_vec = intvec_top; |
971 | 971 | ||
972 | /* Check for "big-endian" in device-tree */ | 972 | /* Check for "big-endian" in device-tree */ |
973 | if (node && get_property(node, "big-endian", NULL) != NULL) | 973 | if (node && of_get_property(node, "big-endian", NULL) != NULL) |
974 | mpic->flags |= MPIC_BIG_ENDIAN; | 974 | mpic->flags |= MPIC_BIG_ENDIAN; |
975 | 975 | ||
976 | 976 | ||
@@ -986,13 +986,13 @@ struct mpic * __init mpic_alloc(struct device_node *node, | |||
986 | BUG_ON(paddr == 0 && node == NULL); | 986 | BUG_ON(paddr == 0 && node == NULL); |
987 | 987 | ||
988 | /* If no physical address passed in, check if it's dcr based */ | 988 | /* If no physical address passed in, check if it's dcr based */ |
989 | if (paddr == 0 && get_property(node, "dcr-reg", NULL) != NULL) | 989 | if (paddr == 0 && of_get_property(node, "dcr-reg", NULL) != NULL) |
990 | mpic->flags |= MPIC_USES_DCR; | 990 | mpic->flags |= MPIC_USES_DCR; |
991 | 991 | ||
992 | #ifdef CONFIG_PPC_DCR | 992 | #ifdef CONFIG_PPC_DCR |
993 | if (mpic->flags & MPIC_USES_DCR) { | 993 | if (mpic->flags & MPIC_USES_DCR) { |
994 | const u32 *dbasep; | 994 | const u32 *dbasep; |
995 | dbasep = get_property(node, "dcr-reg", NULL); | 995 | dbasep = of_get_property(node, "dcr-reg", NULL); |
996 | BUG_ON(dbasep == NULL); | 996 | BUG_ON(dbasep == NULL); |
997 | mpic->dcr_base = *dbasep; | 997 | mpic->dcr_base = *dbasep; |
998 | mpic->reg_type = mpic_access_dcr; | 998 | mpic->reg_type = mpic_access_dcr; |
@@ -1006,7 +1006,7 @@ struct mpic * __init mpic_alloc(struct device_node *node, | |||
1006 | */ | 1006 | */ |
1007 | if (paddr == 0 && !(mpic->flags & MPIC_USES_DCR)) { | 1007 | if (paddr == 0 && !(mpic->flags & MPIC_USES_DCR)) { |
1008 | const u32 *reg; | 1008 | const u32 *reg; |
1009 | reg = get_property(node, "reg", NULL); | 1009 | reg = of_get_property(node, "reg", NULL); |
1010 | BUG_ON(reg == NULL); | 1010 | BUG_ON(reg == NULL); |
1011 | paddr = of_translate_address(node, reg); | 1011 | paddr = of_translate_address(node, reg); |
1012 | BUG_ON(paddr == OF_BAD_ADDR); | 1012 | BUG_ON(paddr == OF_BAD_ADDR); |
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c index 43f6cc9d7ea0..7f4c07543961 100644 --- a/arch/powerpc/sysdev/qe_lib/qe.c +++ b/arch/powerpc/sysdev/qe_lib/qe.c | |||
@@ -71,7 +71,7 @@ phys_addr_t get_qe_base(void) | |||
71 | qe = of_find_node_by_type(NULL, "qe"); | 71 | qe = of_find_node_by_type(NULL, "qe"); |
72 | if (qe) { | 72 | if (qe) { |
73 | unsigned int size; | 73 | unsigned int size; |
74 | const void *prop = get_property(qe, "reg", &size); | 74 | const void *prop = of_get_property(qe, "reg", &size); |
75 | qebase = of_translate_address(qe, prop); | 75 | qebase = of_translate_address(qe, prop); |
76 | of_node_put(qe); | 76 | of_node_put(qe); |
77 | }; | 77 | }; |
@@ -158,7 +158,7 @@ unsigned int get_brg_clk(void) | |||
158 | qe = of_find_node_by_type(NULL, "qe"); | 158 | qe = of_find_node_by_type(NULL, "qe"); |
159 | if (qe) { | 159 | if (qe) { |
160 | unsigned int size; | 160 | unsigned int size; |
161 | const u32 *prop = get_property(qe, "brg-frequency", &size); | 161 | const u32 *prop = of_get_property(qe, "brg-frequency", &size); |
162 | brg_clk = *prop; | 162 | brg_clk = *prop; |
163 | of_node_put(qe); | 163 | of_node_put(qe); |
164 | }; | 164 | }; |
diff --git a/arch/powerpc/sysdev/qe_lib/qe_io.c b/arch/powerpc/sysdev/qe_lib/qe_io.c index 0afe6bfe3714..e32b45bf9ff5 100644 --- a/arch/powerpc/sysdev/qe_lib/qe_io.c +++ b/arch/powerpc/sysdev/qe_lib/qe_io.c | |||
@@ -53,7 +53,7 @@ int par_io_init(struct device_node *np) | |||
53 | return ret; | 53 | return ret; |
54 | par_io = ioremap(res.start, res.end - res.start + 1); | 54 | par_io = ioremap(res.start, res.end - res.start + 1); |
55 | 55 | ||
56 | num_ports = get_property(np, "num-ports", NULL); | 56 | num_ports = of_get_property(np, "num-ports", NULL); |
57 | if (num_ports) | 57 | if (num_ports) |
58 | num_par_io_ports = *num_ports; | 58 | num_par_io_ports = *num_ports; |
59 | 59 | ||
@@ -161,7 +161,7 @@ int par_io_of_config(struct device_node *np) | |||
161 | return -1; | 161 | return -1; |
162 | } | 162 | } |
163 | 163 | ||
164 | ph = get_property(np, "pio-handle", NULL); | 164 | ph = of_get_property(np, "pio-handle", NULL); |
165 | if (ph == 0) { | 165 | if (ph == 0) { |
166 | printk(KERN_ERR "pio-handle not available \n"); | 166 | printk(KERN_ERR "pio-handle not available \n"); |
167 | return -1; | 167 | return -1; |
@@ -169,7 +169,7 @@ int par_io_of_config(struct device_node *np) | |||
169 | 169 | ||
170 | pio = of_find_node_by_phandle(*ph); | 170 | pio = of_find_node_by_phandle(*ph); |
171 | 171 | ||
172 | pio_map = get_property(pio, "pio-map", &pio_map_len); | 172 | pio_map = of_get_property(pio, "pio-map", &pio_map_len); |
173 | if (pio_map == NULL) { | 173 | if (pio_map == NULL) { |
174 | printk(KERN_ERR "pio-map is not set! \n"); | 174 | printk(KERN_ERR "pio-map is not set! \n"); |
175 | return -1; | 175 | return -1; |
diff --git a/arch/powerpc/sysdev/tsi108_dev.c b/arch/powerpc/sysdev/tsi108_dev.c index 97f37ef4bbbf..337039ee51e6 100644 --- a/arch/powerpc/sysdev/tsi108_dev.c +++ b/arch/powerpc/sysdev/tsi108_dev.c | |||
@@ -48,7 +48,7 @@ phys_addr_t get_csrbase(void) | |||
48 | tsi = of_find_node_by_type(NULL, "tsi-bridge"); | 48 | tsi = of_find_node_by_type(NULL, "tsi-bridge"); |
49 | if (tsi) { | 49 | if (tsi) { |
50 | unsigned int size; | 50 | unsigned int size; |
51 | const void *prop = get_property(tsi, "reg", &size); | 51 | const void *prop = of_get_property(tsi, "reg", &size); |
52 | tsi108_csr_base = of_translate_address(tsi, prop); | 52 | tsi108_csr_base = of_translate_address(tsi, prop); |
53 | of_node_put(tsi); | 53 | of_node_put(tsi); |
54 | }; | 54 | }; |
@@ -77,10 +77,10 @@ static int __init tsi108_eth_of_init(void) | |||
77 | struct resource r[2]; | 77 | struct resource r[2]; |
78 | struct device_node *phy; | 78 | struct device_node *phy; |
79 | hw_info tsi_eth_data; | 79 | hw_info tsi_eth_data; |
80 | unsigned int *id; | 80 | const unsigned int *id; |
81 | unsigned int *phy_id; | 81 | const unsigned int *phy_id; |
82 | const void *mac_addr; | 82 | const void *mac_addr; |
83 | phandle *ph; | 83 | const phandle *ph; |
84 | 84 | ||
85 | memset(r, 0, sizeof(r)); | 85 | memset(r, 0, sizeof(r)); |
86 | memset(&tsi_eth_data, 0, sizeof(tsi_eth_data)); | 86 | memset(&tsi_eth_data, 0, sizeof(tsi_eth_data)); |
@@ -107,10 +107,10 @@ static int __init tsi108_eth_of_init(void) | |||
107 | goto err; | 107 | goto err; |
108 | } | 108 | } |
109 | 109 | ||
110 | mac_addr = get_property(np, "address", NULL); | 110 | mac_addr = of_get_property(np, "address", NULL); |
111 | memcpy(tsi_eth_data.mac_addr, mac_addr, 6); | 111 | memcpy(tsi_eth_data.mac_addr, mac_addr, 6); |
112 | 112 | ||
113 | ph = (phandle *) get_property(np, "phy-handle", NULL); | 113 | ph = of_get_property(np, "phy-handle", NULL); |
114 | phy = of_find_node_by_phandle(*ph); | 114 | phy = of_find_node_by_phandle(*ph); |
115 | 115 | ||
116 | if (phy == NULL) { | 116 | if (phy == NULL) { |
@@ -118,8 +118,8 @@ static int __init tsi108_eth_of_init(void) | |||
118 | goto unreg; | 118 | goto unreg; |
119 | } | 119 | } |
120 | 120 | ||
121 | id = (u32 *) get_property(phy, "reg", NULL); | 121 | id = of_get_property(phy, "reg", NULL); |
122 | phy_id = (u32 *) get_property(phy, "phy-id", NULL); | 122 | phy_id = of_get_property(phy, "phy-id", NULL); |
123 | ret = of_address_to_resource(phy, 0, &res); | 123 | ret = of_address_to_resource(phy, 0, &res); |
124 | if (ret) { | 124 | if (ret) { |
125 | of_node_put(phy); | 125 | of_node_put(phy); |
diff --git a/arch/powerpc/sysdev/tsi108_pci.c b/arch/powerpc/sysdev/tsi108_pci.c index ae249c6bbbcf..58b9e7f8abf2 100644 --- a/arch/powerpc/sysdev/tsi108_pci.c +++ b/arch/powerpc/sysdev/tsi108_pci.c | |||
@@ -211,7 +211,7 @@ int __init tsi108_setup_pci(struct device_node *dev) | |||
211 | has_address = (of_address_to_resource(dev, 0, &rsrc) == 0); | 211 | has_address = (of_address_to_resource(dev, 0, &rsrc) == 0); |
212 | 212 | ||
213 | /* Get bus range if any */ | 213 | /* Get bus range if any */ |
214 | bus_range = get_property(dev, "bus-range", &len); | 214 | bus_range = of_get_property(dev, "bus-range", &len); |
215 | if (bus_range == NULL || len < 2 * sizeof(int)) { | 215 | if (bus_range == NULL || len < 2 * sizeof(int)) { |
216 | printk(KERN_WARNING "Can't get bus-range for %s, assume" | 216 | printk(KERN_WARNING "Can't get bus-range for %s, assume" |
217 | " bus 0\n", dev->full_name); | 217 | " bus 0\n", dev->full_name); |