of_fdt_unflatten_tree(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… of_fdt_unflatten_tree(9) β€” the Kernel API Manual glow-up ✨

okay so bestie, welcome to the Kernel API Manual entry for of_fdt_unflatten_tree(9). yes the manual name is literally that, we're folding it in like a cute little name tag πŸŽ€ this whole page is about turning a squished-flat device tree blob into an actual tree you can walk around in. iconic behaviour, honestly.


🌸 NAME 🌸

of_fdt_unflatten_tree β€” create tree of device_nodes from flat blob

like… the whole gig. flat blob goes in, tree of device_nodes comes out. no cap πŸ¦‹


✨ SYNOPSIS ✨

void * of_fdt_unflatten_tree (const unsigned long *blob , struct
       device_node *dad , struct device_node **mynodes );

three args, one pointer coming back at you. eat it up πŸ”₯


πŸŽ€ ARGUMENTS πŸŽ€

  • blob β€” Flat device tree blob. this is the squished one, the unflattened rawness, the before-picture πŸ’€
  • dad β€” Parent device node. yes, dad. the father node. the one it gets attached under 🫢
  • mynodes β€” The device tree created by the call. this is where the output goes, it's an out-param bestie, watch it πŸ”₯

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so what this does is it unflattens the device-tree that got passed over by the firmware β€” literally takes the flat version and creates the tree of struct device_node. the way that this is the main character function of the whole file, honestly πŸ‘‘

and it doesn't stop there β€” it also fills the "name" and "type" pointers of the nodes so that the normal device-tree walking functions can be used. so like, all the standard walking stuff just works afterwards. no extra setup, no vibes check, it just works. periodt πŸ’…


⭐ RETURN ⭐

  • NULL on failure 😭
  • or β€” on success β€” the memory chunk containing the unflattened device tree πŸ’–

that's it. two outcomes. very binary of it.


πŸ’œ SEE ALSO πŸ’œ

lowkey the whole friend group is here, all in the Kernel file ./drivers/of/fdt.c:

read them all, iykyk 🌈


real talk bestie: if it returns NULL, that's failure β€” don't go dereferencing the void, that's not the vibe πŸ™ˆ

and that's the page!! πŸŽ€ sourced from ./drivers/of β€” October 2026 edition, and yes of_fdt_unflatten_tree(9) is the title of the whole thing, we're just ending on a cute sign-off. go unflatten some trees bestie, slay πŸ’–βœ¨πŸŒΈ

πŸ“¦ where this page comes from