[PATCH] powerpc: add for_each_node_by_foo helpers

Nathan Lynch ntl at pobox.com
Mon Mar 13 09:18:17 EST 2006


Benjamin Herrenschmidt wrote:
> On Wed, 2006-03-08 at 16:47 +0100, Christoph Hellwig wrote:
> > Typical use for of_find_node_by_name and of_find_node_by_type is to
> > iterate over all nodes of a given type/name.  Add a helper macro to
> > do that (in spirit of the list_for_each* macros).
> 
> Looks good. Maybe you have noted however that we aren't entirely safe
> yet vs. device-tree being dynamic however. There is a per-node lock, but
> no lock protecting the global node chain, which as usual means iterating
> the list isn't entirely safe vs. removal...

Eh?  There isn't any per-node lock, and the global chain is protected
by a rwlock (devtree_lock).



More information about the Linuxppc64-dev mailing list