OF_CHILD(9)
πΈ NAME πΈ
okay so bestie, this is the OF_CHILD(9) page from the Kernel Developer's Manual π and it's all about OF_child, OF_parent, and OF_peer β navigate device tree energy, fr fr. no cap.
β¨ SYNOPSIS β¨
first, include these headers, periodt:
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
then the function signatures, exactly like this:
phandle_t
OF_child(phandle_t node);
phandle_t
OF_parent(phandle_t node);
phandle_t
OF_peer(phandle_t node);
π DESCRIPTION π
OF_child()β returns the phandle value of the first child of node. zero is returned if there are no child nodes. slay.OF_parent()β returns the phandle for the parent of node. zero is returned if node is the root node. obsessed.OF_peer()β returns the phandle value of the next sibling of node. zero is returned if there is no sibling node. iconic.
π EXAMPLES π
example time, bestie β here's the loop exactly as the page gives it:
phandle_t node, child;
...
for (child = OF_child(node); child != 0; child = OF_peer(child) {
...
}
π¦ SEE ALSO π¦
OF_finddevice(9)β the see-also reference on this page. go look at it when you're done here π
π AUTHORS π
This manual page was written by Oleksandr Tymoshenko <gonzo@FreeBSD.org>. give them their flowers π
xoxo, your Unix bestie π β source/version: Debian, date: April 9, 2018, and this was the OF_CHILD(9) page. periodt β¨
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2018 Oleksandr Tymoshenko <gonzo@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms