of_get_next_cpu_node(9)
π NAME π
okay so of_get_next_cpu_node β bestie, it's literally the "iterate on cpu nodes" function, that's the whole vibe β¨ (manual fam: Kernel API Manual π)
πΈ SYNOPSIS πΈ
struct device_node * of_get_next_cpu_node (struct device_node *prev );
π¦ ARGUMENTS π¦
prevβ the previous child of the/cpusnode, orNULLif you wanna grab the very first one π«Ά (yes, passingNULLis the "start me from the top" move, no cap)
β¨ DESCRIPTION β¨
so like, here's the tea β β unusable CPUs get skipped. and by "unusable" we mean the ones whose status property is set to "fail" or "fail-..." π they literally do not get a turn, they're not invited to the function, it's giving filtered out fr fr.
π RETURN π
you get back a cpu node pointer with its refcount incremented π₯ β so bestie, you must call of_node_put on it when you're done, that's not optional, that's the rule π
and if prev happens to be the last child? you get NULL back. that's the end of the line, the credits rolling, the π¬.
oh also β it decrements the refcount of prev. so it's doing cleanup on its way past, iconic behavior honestly π
π₯ SEE ALSO π₯
the kernel file is ./drivers/of/base.c and here's the whole extended friend group of of_* besties (they all live in the same section 9 neighborhood, iykyk) π
of_find_all_nodes(9)__of_device_is_compatible(9)of_machine_compatible_match(9)of_machine_read_compatible(9)of_machine_read_model(9)of_machine_get_match(9)of_machine_get_match_data(9)__of_device_is_available(9)__of_device_is_reserved(9)of_device_is_available(9)__of_device_is_fail(9)of_device_is_big_endian(9)of_get_parent(9)of_get_next_parent(9)of_get_next_child(9)of_get_next_child_with_prefix(9)of_get_next_available_child(9)of_get_next_reserved_child(9)of_get_compatible_child(9)of_get_child_by_name(9)of_get_available_child_by_name(9)of_find_node_opts_by_path(9)of_find_node_by_name(9)of_find_node_by_type(9)of_find_compatible_node(9)of_find_node_with_property(9)of_match_node(9)of_find_matching_node_and_match(9)of_alias_from_compatible(9)of_find_node_by_phandle(9)of_parse_phandle_with_args_map(9)of_count_phandle_with_args(9)__of_add_property(9)of_add_property(9)of_remove_property(9)of_alias_scan(9)of_alias_get_id(9)of_alias_get_highest_id(9)of_console_check(9)of_find_next_cache_node(9)of_find_last_cache_level(9)of_map_id(9)of_map_iommu_id(9)of_map_msi_id(9)
okay that's the whole page, mwah π this lil beauty ships from ./drivers/of and it's dated October 2026 πΈ and it's filed under of_get_next_cpu_node(9) in case you need to find it again β go forth and iterate responsibly bestie, and don't forget of_node_put or I will find out π§ββοΈπ
π¦ 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