[RFC/PATCH 4/4] Add support for MSI on Axon-based Cell systems

Arnd Bergmann arnd at arndb.de
Sat Jun 9 06:06:55 EST 2007


On Friday 08 June 2007, Segher Boessenkool wrote:
> > That wasn't my question though?
> 
> Oh wait.  You're saying for_each_compatible_node() does
> a put() on all nodes it traverses, but no get()?  Ouch!

No, just read the code, it does exactly the right thing.

If you do

for_each_compatible_node(node, NULL, "foo") {
	do_something(node);
}

then the reference count is held just as long as the do_something()
function is run, and if you do

for_each_compatible_node(node, NULL, "foo")
	if (conditional_func(node))
		break;

then the node variable will have the reference count.

	Arnd <><



More information about the Linuxppc-dev mailing list