OF_child(9)

OF_child9

Navigate device tree

Usage

#include <dev/ofw/ofw_bus.h>

#include <dev/ofw/ofw_bus_subr.h>

phandle_t

OF_child(phandle_t node);

phandle_t

OF_parent(phandle_t node);

phandle_t

OF_peer(phandle_t node);

Overview

OF_child() returns the phandle value of the first child of the node. Zero is returned if there are no child nodes.

OF_parent() returns the phandle for the parent of the node. Zero is returned if node is the root node.

OF_peer() returns the phandle value of the next sibling of the node. Zero is returned if there is no sibling node.

Examples

phandle_t node, child;
 ...
for (child = OF_child(node); child != 0; child = OF_peer(child) {
	...
}

Releases

20 releases since FreeBSD 12.0-RELEASE; the text changed 6 times.

  1. 12.0
  2. 12.1
  3. 12.2
  4. 12.3
  5. 12.4
  6. 13.0–13.2
  7. 13.3–16.0

Authors

This manual page was written by Oleksandr Tymoshenko ⟨[email protected]⟩.

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.