.. | .. |
---|
8 | 8 | #include <linux/delay.h> |
---|
9 | 9 | #include <linux/string.h> |
---|
10 | 10 | #include <linux/init.h> |
---|
| 11 | +#include <linux/pgtable.h> |
---|
11 | 12 | |
---|
12 | 13 | #include <asm/io.h> |
---|
13 | | -#include <asm/pgtable.h> |
---|
14 | 14 | #include <asm/irq.h> |
---|
15 | 15 | #include <asm/hydra.h> |
---|
16 | 16 | #include <asm/prom.h> |
---|
.. | .. |
---|
230 | 230 | else if (strncmp(machine, "Pegasos", 7) == 0) |
---|
231 | 231 | is_pegasos = 1; |
---|
232 | 232 | } |
---|
233 | | - for (dev = root->child; dev != NULL; dev = dev->sibling) { |
---|
234 | | - if (dev->type == NULL || strcmp(dev->type, "pci") != 0) |
---|
| 233 | + for_each_child_of_node(root, dev) { |
---|
| 234 | + if (!of_node_is_type(dev, "pci")) |
---|
235 | 235 | continue; |
---|
236 | 236 | ++index; |
---|
237 | 237 | /* The GG2 bridge on the LongTrail doesn't have an address */ |
---|