fdt_for_each_subnode(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay bestie, welcome to the Kernel API Manual page for fdt_for_each_subnode(9) β€” it’s giving β€œloop over a parent’s subnodes” and honestly it ate πŸ’…βœ¨

🌸 NAME 🌸

fdt_for_each_subnode β€” iterate over all subnodes of a parent πŸ¦‹

✨ SYNOPSIS ✨

fdt_for_each_subnode (node , fdt , parent );

πŸŽ€ ARGUMENTS πŸŽ€

  • node β€” the child node, type int, and it’s an lvalue (yes bestie, it’s the iterator in the loop) 🫢
  • fdt β€” the FDT blob, type const void * 🌈
  • parent β€” the parent node, type int πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so real talk: this is literally a wrapper around a for loop, and it’s used like this:

fdt_for_each_subnode(node, fdt, parent) { Use node ...  }

then you do your error handling like this:

if ((node < 0) && (node != -FDT_ERR_NOTFOUND)) { Error handling }

vibe check / important note: this whole thing is implemented as a macro, and node is used as the iterator in the loop. the parent variable can be constant or even a literal β€” fr fr, no cap πŸ’…

πŸ’œ SEE ALSO πŸ’œ

Kernel file: ./scripts/dtc/libfdt/libfdt.h πŸ—‚οΈ


kisses bestie πŸ’– this page comes from ./scripts/dtc/libfdt, dated October 2026, and it’s the fdt_for_each_subnode(9) manual β€” periodt. 🫢✨

πŸ“¦ where this page comes from