[PATCH 12/16] Use of_get_next_child() in eeh_add_device_tree_early()
Michael Ellerman
michael at ellerman.id.au
Fri Oct 26 16:54:44 EST 2007
We should use of_get_next_child() in the eeh_add_device_tree_early()
routine to safely traverse the node's children.
Signed-off-by: Michael Ellerman <michael at ellerman.id.au>
---
arch/powerpc/platforms/pseries/eeh.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index abe3de1..d1d6d55 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -1120,7 +1120,7 @@ static void eeh_add_device_early(struct device_node *dn)
void eeh_add_device_tree_early(struct device_node *dn)
{
struct device_node *sib;
- for (sib = dn->child; sib; sib = sib->sibling)
+ for (sib = NULL; (sib = of_get_next_child(dn, sib));)
eeh_add_device_tree_early(sib);
eeh_add_device_early(dn);
}
--
1.5.2.rc1.1884.g59b20
More information about the Linuxppc-dev
mailing list