__unflatten_device_tree(9)
π¦ 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β thedevice_nodetree 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, setsOF_DETACHEDonmynodes. 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:
unflatten_dt_nodes(9)of_fdt_unflatten_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)
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
- 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