for_each_padev(9)
π for_each_padev β like, the whole device tree, but make it a walk
okay so bestie, you found the for_each_padev(9) page in the Kernel API Manual and honestly? it's giving "short but iconic." let me break it down for you π«Ά
β¨ NAME β¨
for_each_padev β iterate over, like, every single device in the tree. all of them. no skipping. π
π SYNOPSIS π
int for_each_padev (int (*fn)(struct device *, void *) , void * data );
πΈ ARGUMENTS πΈ
fnβ the function you want called on each device. your little callback bestie that gets pinged for every node, no cap.dataβ whatever data you want passed along to that called function. it just gets handed straight through. π§
π¦ DESCRIPTION π¦
so here's the vibe: this does a depth-first traversal of the tree, and it calls the function you passed in for each node. π
and the order matters β it calls the function for parents before children. yes, that's the whole point. main character parent energy first, then the kids. periodt. π
π₯ SEE ALSO π₯
Kernel file ./arch/parisc/kernel/drivers.c β and like, the entire friend group:
match_device(9)register_parisc_driver(9)count_parisc_driver(9)unregister_parisc_driver(9)find_pa_parent_type(9)print_pa_hwpath(9)get_pci_node_path(9)print_pci_hwpath(9)alloc_tree_node(9)register_parisc_device(9)match_pci_device(9)match_parisc_device(9)parse_tree_node(9)hwpath_to_device(9)device_to_hwpath(9)walk_native_bus(9)walk_central_bus(9)init_parisc_bus(9)print_parisc_devices(9)
go read them too, iykyk πβ¨
ngl bestie, that's the whole page. depth-first, parents first, call the function on every node. ate and left no crumbs. π
okay and for the little sign-off moment: this one lives in ./arch/parisc/kernel, it's the October 2026 edition, and the page itself is for_each_padev(9). that's a wrap, mwah ππ
π¦ 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