forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/arch/powerpc/platforms/chrp/pci.c
....@@ -8,9 +8,9 @@
88 #include <linux/delay.h>
99 #include <linux/string.h>
1010 #include <linux/init.h>
11
+#include <linux/pgtable.h>
1112
1213 #include <asm/io.h>
13
-#include <asm/pgtable.h>
1414 #include <asm/irq.h>
1515 #include <asm/hydra.h>
1616 #include <asm/prom.h>
....@@ -230,8 +230,8 @@
230230 else if (strncmp(machine, "Pegasos", 7) == 0)
231231 is_pegasos = 1;
232232 }
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"))
235235 continue;
236236 ++index;
237237 /* The GG2 bridge on the LongTrail doesn't have an address */