[PATCH 11/16] Use of_get_next_child() in eeh_restore_bars()
Michael Ellerman
michael at ellerman.id.au
Mon Oct 29 14:46:13 EST 2007
On Fri, 2007-10-26 at 17:29 +1000, Stephen Rothwell wrote:
> On Fri, 26 Oct 2007 16:54:43 +1000 (EST) Michael Ellerman <michael at ellerman.id.au> wrote:
> >
> > +++ b/arch/powerpc/platforms/pseries/eeh.c
> > @@ -841,11 +841,8 @@ void eeh_restore_bars(struct pci_dn *pdn)
> > if ((pdn->eeh_mode & EEH_MODE_SUPPORTED) && !IS_BRIDGE(pdn->class_code))
> > __restore_bars (pdn);
> >
> > - dn = pdn->node->child;
> > - while (dn) {
> > + for (dn = NULL; (dn = of_get_next_child(pdn->node, dn));)
>
> Just wondering if we need
>
> #define for_each_child_node(dn, parent) \
> for (dn = of_get_next_child(parent, NULL); dn; \
> dn = of_get_next_child(parent, dn))
Hmm, perhaps. I count ~30 places we could use it under arch/powerpc, and
about another ~20 in drivers/.
If no one objects, I guess I'll get to it, sigh ... another Yak.
Should we perhaps make it for_each_child_device_node() ?
Otherwise it's slightly non obvious what kind of node it's talking
about, especially in driver code.
cheers
--
Michael Ellerman
OzLabs, IBM Australia Development Lab
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20071029/25398cd8/attachment.pgp>
More information about the Linuxppc-dev
mailing list