[PATCH] powerpc: add for_each_node_by_foo helpers

Benjamin Herrenschmidt benh at kernel.crashing.org
Sun Mar 12 10:22:19 EST 2006


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...

I've been wondering about using some of the new klist stuff for that...

Ben.





More information about the Linuxppc64-dev mailing list