hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/powerpc/platforms/maple/pci.c
....@@ -1,11 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (C) 2004 Benjamin Herrenschmuidt (benh@kernel.crashing.org),
34 * IBM Corp.
4
- *
5
- * This program is free software; you can redistribute it and/or
6
- * modify it under the terms of the GNU General Public License
7
- * as published by the Free Software Foundation; either version
8
- * 2 of the License, or (at your option) any later version.
95 */
106
117 #undef DEBUG
....@@ -604,10 +600,8 @@
604600 printk(KERN_CRIT "maple_find_bridges: can't find root of device tree\n");
605601 return;
606602 }
607
- for (np = NULL; (np = of_get_next_child(root, np)) != NULL;) {
608
- if (!np->type)
609
- continue;
610
- if (strcmp(np->type, "pci") && strcmp(np->type, "ht"))
603
+ for_each_child_of_node(root, np) {
604
+ if (!of_node_is_type(np, "pci") && !of_node_is_type(np, "ht"))
611605 continue;
612606 if ((of_device_is_compatible(np, "u4-pcie") ||
613607 of_device_is_compatible(np, "u3-agp")) &&