of_scan_flat_dt(9)
πΈ NAME πΈ
of_scan_flat_dt β bestie, this one scans the flattened tree blob and hits up your callback on each node π
(we're in the Kernel API Manual, in case the vibe check needed a label β¨)
π SYNOPSIS π
int of_scan_flat_dt (int (*it)(unsigned long node, const char *uname,
int depth, void *data) , void *data );
π¦ ARGUMENTS π¦
itβ the callback function, aka the little guy that gets called for every node π«Άdataβ the context data pointer, your emotional support pointer, passed right along π
π DESCRIPTION π
Okay so real talk: this function is for scanning the flattened device-tree β¨. It exists so you can yank the memory information out at boot, before we're even allowed to unflatten the tree π like the tree's still flat, the info's still in there, and of_scan_flat_dt is the one who goes and gets it. Main character energy, no cap π.
It literally calls your callback on each node it finds. That's it. That's the whole gig. Slay π .
π SEE ALSO π
Kernel file ./drivers/of/fdt.c and its whole friend group π«Ά β go say hi:
unflatten_dt_nodes(9)__unflatten_device_tree(9)of_fdt_unflatten_tree(9)early_init_fdt_scan_reserved_mem(9)early_init_fdt_reserve_self(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)
okay that's the whole page, bestie, ily, go scan some trees π³β¨ β this masterpiece lives in ./drivers/of, dated October 2026, and it's signed off with a kiss π π 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