FreeBSD/sys/dev/ofw/openfirm.c
/*
 * Recursively search the node and its parent for the given property, working
 * downward from the node to the device tree root.  Returns the value of the
 * first match.
 */
Recursively search the node and its parent for the given property, working
downward from the node to the device tree root.  Returns the value of the
first match.
Recursively search the node and its parent for the given property working downward from the node to the device tree root . Returns the value of the first match .
ssize_t
OF_searchprop(phandle_t node, const char *propname, void *buf, size_t len)
{
	ssize_t rv;
	for (; node != 0; node = OF_parent(node))
		if ((rv = OF_getprop(node, propname, buf, len)) != -1)
			return (rv);
	return (-1);
}
ssize_t OF_searchprop ( phandle_t node , const char * propname , void * buf , size_t len ) { ssize_t rv ; for ( ; node != 0 ; node = OF_parent ( node ) ) if ( ( rv = OF_getprop ( node , propname , buf , len ) ) != -1 ) return ( rv ) ; return ( -1 ) ; }
Recursively search the node and its parent for the given property, working
 downward from the node to the device tree root.
Recursively search the node and its parent for the given property working downward from the node to the device tree root .