.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2004 Benjamin Herrenschmuidt (benh@kernel.crashing.org), |
---|
3 | 4 | * 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. |
---|
9 | 5 | */ |
---|
10 | 6 | |
---|
11 | 7 | #undef DEBUG |
---|
.. | .. |
---|
604 | 600 | printk(KERN_CRIT "maple_find_bridges: can't find root of device tree\n"); |
---|
605 | 601 | return; |
---|
606 | 602 | } |
---|
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")) |
---|
611 | 605 | continue; |
---|
612 | 606 | if ((of_device_is_compatible(np, "u4-pcie") || |
---|
613 | 607 | of_device_is_compatible(np, "u3-agp")) && |
---|