__unflatten_device_tree(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ NAME πŸ¦‹

okay so bestie, welcome to the __unflatten_device_tree(9) page β€” it's a Kernel API Manual moment, and this one's literally about creating a tree of device_nodes from a flat blob ✨


πŸŽ€ SYNOPSIS πŸŽ€

void * __unflatten_device_tree (const void *blob , struct device_node
*dad , struct device_node **mynodes , void *(*dt_alloc)(u64 size, u64
align) , bool detached );

πŸ’… ARGUMENTS πŸ’…

  • blob β€” the blob we're expanding, no cap. It's the flat thing going in 🫢
  • dad β€” the parent device node. yes his name is dad. iconic, we don't ask questions πŸ‘‘
  • mynodes β€” the device_node tree that the call creates. it's giving "here's your output" πŸ’–
  • dt_alloc β€” an allocator that provides a virtual address to memory for the resulting tree. lowkey the most important one, she's doing the actual work 🧚
  • detached β€” if true, sets OF_DETACHED on mynodes. simple as that fr fr

🌸 DESCRIPTION 🌸

so what it does: it unflattens a device-tree, creating the tree of struct device_node. ✨ the way that it also fills the "name" and "type" pointers of the nodes β€” that's the whole point, bestie β€” so the normal device-tree walking functions can actually be used. slay πŸ”₯


⭐ RETURN ⭐

NULL on failure πŸ’€ β€” or the memory chunk containing the unflattened device tree on success πŸŽ‰ choose your fighter.


🌈 SEE ALSO 🌈

Kernel file ./drivers/of/fdt.c, plus the whole friend group:


ngl that's a lot of of_ functions but they're all valid, go read them 🫢

and that's the page!! πŸ“ from ./drivers/of, dated October 2026, version vibes courtesy of the Kernel API Manual β€” __unflatten_device_tree(9), periodt πŸ’œπŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from