diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2007-04-23 23:53:04 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-04-24 08:09:02 -0400 |
commit | 30686ba6d56858657829d3eb524ed73e5dc98d2b (patch) | |
tree | 42bf3cea4dc7028fec30377560b367cd8274825e /arch/powerpc/platforms/chrp | |
parent | 1658ab66781d918f604c6069c5cf9a94b6f52f84 (diff) |
[POWERPC] Remove old interface find_devices
Replace uses with of_find_node_by_name and for_each_node_by_name.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/chrp')
-rw-r--r-- | arch/powerpc/platforms/chrp/pci.c | 6 | ||||
-rw-r--r-- | arch/powerpc/platforms/chrp/setup.c | 9 |
2 files changed, 10 insertions, 5 deletions
diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c index de776e3889e3..1469d6478f67 100644 --- a/arch/powerpc/platforms/chrp/pci.c +++ b/arch/powerpc/platforms/chrp/pci.c | |||
@@ -136,9 +136,11 @@ hydra_init(void) | |||
136 | struct device_node *np; | 136 | struct device_node *np; |
137 | struct resource r; | 137 | struct resource r; |
138 | 138 | ||
139 | np = find_devices("mac-io"); | 139 | np = of_find_node_by_name(NULL, "mac-io"); |
140 | if (np == NULL || of_address_to_resource(np, 0, &r)) | 140 | if (np == NULL || of_address_to_resource(np, 0, &r)) { |
141 | of_node_put(np); | ||
141 | return 0; | 142 | return 0; |
143 | } | ||
142 | Hydra = ioremap(r.start, r.end-r.start); | 144 | Hydra = ioremap(r.start, r.end-r.start); |
143 | printk("Hydra Mac I/O at %llx\n", (unsigned long long)r.start); | 145 | printk("Hydra Mac I/O at %llx\n", (unsigned long long)r.start); |
144 | printk("Hydra Feature_Control was %x", | 146 | printk("Hydra Feature_Control was %x", |
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c index 9c1b231b1ff9..1870038a8e0a 100644 --- a/arch/powerpc/platforms/chrp/setup.c +++ b/arch/powerpc/platforms/chrp/setup.c | |||
@@ -468,7 +468,7 @@ static void __init chrp_find_8259(void) | |||
468 | * Also, Pegasos-type platforms don't have a proper node to start | 468 | * Also, Pegasos-type platforms don't have a proper node to start |
469 | * from anyway | 469 | * from anyway |
470 | */ | 470 | */ |
471 | for (np = find_devices("pci"); np != NULL; np = np->next) { | 471 | for_each_node_by_name(np, "pci") { |
472 | const unsigned int *addrp = of_get_property(np, | 472 | const unsigned int *addrp = of_get_property(np, |
473 | "8259-interrupt-acknowledge", NULL); | 473 | "8259-interrupt-acknowledge", NULL); |
474 | 474 | ||
@@ -477,6 +477,7 @@ static void __init chrp_find_8259(void) | |||
477 | chrp_int_ack = addrp[of_n_addr_cells(np)-1]; | 477 | chrp_int_ack = addrp[of_n_addr_cells(np)-1]; |
478 | break; | 478 | break; |
479 | } | 479 | } |
480 | of_node_put(np); | ||
480 | if (np == NULL) | 481 | if (np == NULL) |
481 | printk(KERN_WARNING "Cannot find PCI interrupt acknowledge" | 482 | printk(KERN_WARNING "Cannot find PCI interrupt acknowledge" |
482 | " address, polling\n"); | 483 | " address, polling\n"); |
@@ -518,10 +519,11 @@ void __init chrp_init_IRQ(void) | |||
518 | #if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_XMON) | 519 | #if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_XMON) |
519 | /* see if there is a keyboard in the device tree | 520 | /* see if there is a keyboard in the device tree |
520 | with a parent of type "adb" */ | 521 | with a parent of type "adb" */ |
521 | for (kbd = find_devices("keyboard"); kbd; kbd = kbd->next) | 522 | for_each_node_by_name(kbd, "keyboard") |
522 | if (kbd->parent && kbd->parent->type | 523 | if (kbd->parent && kbd->parent->type |
523 | && strcmp(kbd->parent->type, "adb") == 0) | 524 | && strcmp(kbd->parent->type, "adb") == 0) |
524 | break; | 525 | break; |
526 | of_node_put(kbd); | ||
525 | if (kbd) | 527 | if (kbd) |
526 | setup_irq(HYDRA_INT_ADB_NMI, &xmon_irqaction); | 528 | setup_irq(HYDRA_INT_ADB_NMI, &xmon_irqaction); |
527 | #endif | 529 | #endif |
@@ -547,7 +549,7 @@ chrp_init2(void) | |||
547 | /* Get the event scan rate for the rtas so we know how | 549 | /* Get the event scan rate for the rtas so we know how |
548 | * often it expects a heartbeat. -- Cort | 550 | * often it expects a heartbeat. -- Cort |
549 | */ | 551 | */ |
550 | device = find_devices("rtas"); | 552 | device = of_find_node_by_name(NULL, "rtas"); |
551 | if (device) | 553 | if (device) |
552 | p = of_get_property(device, "rtas-event-scan-rate", NULL); | 554 | p = of_get_property(device, "rtas-event-scan-rate", NULL); |
553 | if (p && *p) { | 555 | if (p && *p) { |
@@ -576,6 +578,7 @@ chrp_init2(void) | |||
576 | printk("RTAS Event Scan Rate: %u (%lu jiffies)\n", | 578 | printk("RTAS Event Scan Rate: %u (%lu jiffies)\n", |
577 | *p, interval); | 579 | *p, interval); |
578 | } | 580 | } |
581 | of_node_put(device); | ||
579 | 582 | ||
580 | if (ppc_md.progress) | 583 | if (ppc_md.progress) |
581 | ppc_md.progress(" Have fun! ", 0x7777); | 584 | ppc_md.progress(" Have fun! ", 0x7777); |