FreeBSD/sys/dev/ofw/ofw_fdt.c
/* Return the next sibling of this node or 0. */
Return the next sibling of this node or 0.
Return the next sibling of this node or 0 .
static phandle_t
ofw_fdt_peer(ofw_t ofw, phandle_t node)
{
	int depth, offset;
	if (node == 0) {
		offset = fdt_path_offset(fdtp, "/");
		return (fdt_offset_phandle(offset));
	}
	offset = fdt_phandle_offset(node);
	if (offset < 0)
		return (0);
	for (depth = 1, offset = fdt_next_node(fdtp, offset, &depth);
	    offset >= 0;
	    offset = fdt_next_node(fdtp, offset, &depth)) {
		if (depth < 0)
			return (0);
		if (depth == 1)
			return (fdt_offset_phandle(offset));
	}
	return (0);
}
static phandle_t ofw_fdt_peer ( ofw_t ofw , phandle_t node ) { int depth , offset ; if ( node == 0 ) { offset = fdt_path_offset ( fdtp , " " ) ; return ( fdt_offset_phandle ( offset ) ) ; } offset = fdt_phandle_offset ( node ) ; if ( offset < 0 ) return ( 0 ) ; for ( depth = 1 , offset = fdt_next_node ( fdtp , offset , & depth ) ; offset >= 0 ; offset = fdt_next_node ( fdtp , offset , & depth ) ) { if ( depth < 0 ) return ( 0 ) ; if ( depth == 1 ) return ( fdt_offset_phandle ( offset ) ) ; } return ( 0 ) ; }
Return the next sibling of this node or 0.
Return the next sibling of this node or 0 .
/* Find root node */