of_count_phandle_with_args(9)
πΈ NAME πΈ
okay so this is of_count_phandle_with_args, and it lives in the Kernel API Manual β iconic behavior, honestly. π
The whole mission is to find the number of phandles references in a property. Thatβs the vibe: count the references, bestie. β¨
β¨ SYNOPSIS β¨
int of_count_phandle_with_args (const struct device_node *np , const
char *list_name , const char *cells_name );
π ARGUMENTS π
npβ pointer to a device tree node containing a list. This is your home base for the list.list_nameβ property name that contains a list. Basically the name of the property youβre checking.cells_nameβ property name that specifies phandlesβ arguments count. It tells you how many arguments are in the mix.
π RETURN π
It returns the number of phandle + argument tuples within a property. π«Ά
It is a typical pattern to encode a list of phandle and variable arguments into a single property. The number of arguments is encoded by a property in the phandle-target node. For example, a gpios property would contain a list of GPIO specifies consisting of a phandle and 1 or more arguments. The number of arguments are determined by the #gpio-cells property in the node pointed to by the phandle. no cap. π
π¦ SEE ALSO π¦
Kernel file ./drivers/of/base.c, plus the whole related-functions friend group:
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_next_cpu_node(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_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)
mwah π β source/version: ./drivers/of, date: October 2026.
π¦ 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