diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2006-07-12 01:40:05 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-07-31 01:55:05 -0400 |
commit | ae6b4101e53dcf8a41f3432dacca9d3eb34e9cc3 (patch) | |
tree | 9144d6ef4e0fcb30900eef1e2b67904fb7266039 /arch/powerpc/platforms/chrp/setup.c | |
parent | c61c27d58af61e5b78257019b173732c29ce0c64 (diff) |
[POWERPC] chrp: Constify & voidify get_property()
Now that get_property() returns a void *, there's no need to cast its
return value. Also, treat the return value as const, so we can
constify get_property later.
chrp platform changes.
Built for chrp32_defconfig
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/chrp/setup.c')
-rw-r--r-- | arch/powerpc/platforms/chrp/setup.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c index be39742db809..488dbd9b51ae 100644 --- a/arch/powerpc/platforms/chrp/setup.c +++ b/arch/powerpc/platforms/chrp/setup.c | |||
@@ -226,8 +226,7 @@ static void __init pegasos_set_l2cr(void) | |||
226 | /* Enable L2 cache if needed */ | 226 | /* Enable L2 cache if needed */ |
227 | np = find_type_devices("cpu"); | 227 | np = find_type_devices("cpu"); |
228 | if (np != NULL) { | 228 | if (np != NULL) { |
229 | unsigned int *l2cr = (unsigned int *) | 229 | const unsigned int *l2cr = get_property(np, "l2cr", NULL); |
230 | get_property (np, "l2cr", NULL); | ||
231 | if (l2cr == NULL) { | 230 | if (l2cr == NULL) { |
232 | printk ("Pegasos l2cr : no cpu l2cr property found\n"); | 231 | printk ("Pegasos l2cr : no cpu l2cr property found\n"); |
233 | return; | 232 | return; |
@@ -252,7 +251,7 @@ static void briq_restart(char *cmd) | |||
252 | void __init chrp_setup_arch(void) | 251 | void __init chrp_setup_arch(void) |
253 | { | 252 | { |
254 | struct device_node *root = find_path_device ("/"); | 253 | struct device_node *root = find_path_device ("/"); |
255 | char *machine = NULL; | 254 | const char *machine = NULL; |
256 | 255 | ||
257 | /* init to some ~sane value until calibrate_delay() runs */ | 256 | /* init to some ~sane value until calibrate_delay() runs */ |
258 | loops_per_jiffy = 50000000/HZ; | 257 | loops_per_jiffy = 50000000/HZ; |
@@ -353,7 +352,7 @@ static void __init chrp_find_openpic(void) | |||
353 | struct device_node *np, *root; | 352 | struct device_node *np, *root; |
354 | int len, i, j; | 353 | int len, i, j; |
355 | int isu_size, idu_size; | 354 | int isu_size, idu_size; |
356 | unsigned int *iranges, *opprop = NULL; | 355 | const unsigned int *iranges, *opprop = NULL; |
357 | int oplen = 0; | 356 | int oplen = 0; |
358 | unsigned long opaddr; | 357 | unsigned long opaddr; |
359 | int na = 1; | 358 | int na = 1; |
@@ -363,8 +362,7 @@ static void __init chrp_find_openpic(void) | |||
363 | return; | 362 | return; |
364 | root = of_find_node_by_path("/"); | 363 | root = of_find_node_by_path("/"); |
365 | if (root) { | 364 | if (root) { |
366 | opprop = (unsigned int *) get_property | 365 | opprop = get_property(root, "platform-open-pic", &oplen); |
367 | (root, "platform-open-pic", &oplen); | ||
368 | na = prom_n_addr_cells(root); | 366 | na = prom_n_addr_cells(root); |
369 | } | 367 | } |
370 | if (opprop && oplen >= na * sizeof(unsigned int)) { | 368 | if (opprop && oplen >= na * sizeof(unsigned int)) { |
@@ -381,7 +379,7 @@ static void __init chrp_find_openpic(void) | |||
381 | 379 | ||
382 | printk(KERN_INFO "OpenPIC at %lx\n", opaddr); | 380 | printk(KERN_INFO "OpenPIC at %lx\n", opaddr); |
383 | 381 | ||
384 | iranges = (unsigned int *) get_property(np, "interrupt-ranges", &len); | 382 | iranges = get_property(np, "interrupt-ranges", &len); |
385 | if (iranges == NULL) | 383 | if (iranges == NULL) |
386 | len = 0; /* non-distributed mpic */ | 384 | len = 0; /* non-distributed mpic */ |
387 | else | 385 | else |
@@ -467,8 +465,8 @@ static void __init chrp_find_8259(void) | |||
467 | * from anyway | 465 | * from anyway |
468 | */ | 466 | */ |
469 | for (np = find_devices("pci"); np != NULL; np = np->next) { | 467 | for (np = find_devices("pci"); np != NULL; np = np->next) { |
470 | unsigned int *addrp = (unsigned int *) | 468 | const unsigned int *addrp = get_property(np, |
471 | get_property(np, "8259-interrupt-acknowledge", NULL); | 469 | "8259-interrupt-acknowledge", NULL); |
472 | 470 | ||
473 | if (addrp == NULL) | 471 | if (addrp == NULL) |
474 | continue; | 472 | continue; |
@@ -527,7 +525,7 @@ void __init | |||
527 | chrp_init2(void) | 525 | chrp_init2(void) |
528 | { | 526 | { |
529 | struct device_node *device; | 527 | struct device_node *device; |
530 | unsigned int *p = NULL; | 528 | const unsigned int *p = NULL; |
531 | 529 | ||
532 | #ifdef CONFIG_NVRAM | 530 | #ifdef CONFIG_NVRAM |
533 | chrp_nvram_init(); | 531 | chrp_nvram_init(); |
@@ -545,8 +543,7 @@ chrp_init2(void) | |||
545 | */ | 543 | */ |
546 | device = find_devices("rtas"); | 544 | device = find_devices("rtas"); |
547 | if (device) | 545 | if (device) |
548 | p = (unsigned int *) get_property | 546 | p = get_property(device, "rtas-event-scan-rate", NULL); |
549 | (device, "rtas-event-scan-rate", NULL); | ||
550 | if (p && *p) { | 547 | if (p && *p) { |
551 | /* | 548 | /* |
552 | * Arrange to call chrp_event_scan at least *p times | 549 | * Arrange to call chrp_event_scan at least *p times |