[POWERPC] Use for_each macros in arch/powerpc/sysdev

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
Cyrill Gorcunov
2007-11-30 06:44:36 +11:00
committed by Paul Mackerras
parent 283029d16a
commit 26cb7d8bbd
6 changed files with 25 additions and 38 deletions

View File

@@ -309,28 +309,23 @@ void __init uic_init_tree(void)
const u32 *interrupts;
/* First locate and initialize the top-level UIC */
np = of_find_compatible_node(NULL, NULL, "ibm,uic");
while (np) {
for_each_compatible_node(np, NULL, "ibm,uic") {
interrupts = of_get_property(np, "interrupts", NULL);
if (! interrupts)
if (!interrupts)
break;
np = of_find_compatible_node(np, NULL, "ibm,uic");
}
BUG_ON(!np); /* uic_init_tree() assumes there's a UIC as the
* top-level interrupt controller */
primary_uic = uic_init_one(np);
if (! primary_uic)
if (!primary_uic)
panic("Unable to initialize primary UIC %s\n", np->full_name);
irq_set_default_host(primary_uic->irqhost);
of_node_put(np);
/* The scan again for cascaded UICs */
np = of_find_compatible_node(NULL, NULL, "ibm,uic");
while (np) {
for_each_compatible_node(np, NULL, "ibm,uic") {
interrupts = of_get_property(np, "interrupts", NULL);
if (interrupts) {
/* Secondary UIC */
@@ -348,8 +343,6 @@ void __init uic_init_tree(void)
/* FIXME: setup critical cascade?? */
}
np = of_find_compatible_node(np, NULL, "ibm,uic");
}
}