[PATCH 06/16] Use of_get_next_child() in pci_dma_bus_setup_pSeries()
Michael Ellerman
michael at ellerman.id.au
Fri Oct 26 16:54:36 EST 2007
pci_dma_bus_setup_pSeries() should use of_get_next_child() to safely
iterate through the nodes children.
Signed-off-by: Michael Ellerman <michael at ellerman.id.au>
---
arch/powerpc/platforms/pseries/iommu.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index ef1aa8d..1a9e14f 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -343,7 +343,7 @@ static void pci_dma_bus_setup_pSeries(struct pci_bus *bus)
of_node_put(isa_dn);
/* Count number of direct PCI children of the PHB. */
- for (children = 0, tmp = dn->child; tmp; tmp = tmp->sibling)
+ for (children = 0, tmp = NULL; (tmp = of_get_next_child(dn, tmp));)
children++;
DBG("Children: %d\n", children);
--
1.5.2.rc1.1884.g59b20
More information about the Linuxppc-dev
mailing list