of_fdt_unflatten_tree(9)
π 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 β
NULLon 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:
unflatten_dt_nodes(9)__unflatten_device_tree(9)early_init_fdt_scan_reserved_mem(9)early_init_fdt_reserve_self(9)of_scan_flat_dt(9)of_scan_flat_dt_subnodes(9)of_get_flat_dt_subnode_by_name(9)of_fdt_is_compatible(9)of_flat_dt_is_compatible(9)of_flat_dt_match_machine(9)early_init_dt_check_for_initrd(9)early_init_dt_check_for_elfcorehdr(9)early_init_dt_check_for_usable_mem_range(9)early_init_dt_check_kho(9)unflatten_device_tree(9)unflatten_and_copy_device_tree(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms