of_parse_pha...ith_args_map(9)
πΈ NAME πΈ
okay bestie, this is the Kernel API Manual page for of_parse_phandle_with_args_map β the header abbreviates it as of_parse_pha...ith_args_map(9) because truncation is lowkey a lifestyle. It Find a node pointed by phandle in a list and remap it. No cap. π
β¨ SYNOPSIS β¨
int of_parse_phandle_with_args_map (const struct device_node *np , const char *list_name , const char *stem_name , int index , struct of_phandle_args *_out_args );
π ARGUMENTS π
npβ pointer to a device tree node containing a list.list_nameβ property name that contains a list.stem_nameβ stem of property names that specify phandles' arguments count.indexβ index of a phandle to parse out._out_argsβ optional pointer to output arguments structure (will be filled).
π DESCRIPTION π
okay so this function is useful to parse lists of phandles and their arguments. Itβs giving βphandle list decoder, but make it remap-aware.β β¨
On success it returns 0 and fills _out_args; on error it returns the appropriate errno value. slay.
The difference between this function and of_parse_phandle_with_args is that this API remaps a phandle if the node the phandle points to has a <stem_name>-map property. Thatβs the whole plot twist, iykyk. π¦
Caller is responsible to call of_node_put on the returned _out_args->np pointer. Donβt forget, bestie β thatβs your cleanup era. π«Ά
Example:
phandle1: node1 {
#list-cells = <2>;
};
phandle2: node2 {
#list-cells = <1>;
};
phandle3: node3 {
#list-cells = <1>;
list-map = <0 phandle2 3>,
<1 phandle2 2>,
<2 phandle1 5 1>;
list-map-mask = <0x3>;
};
node4 {
list = <phandle1 1 2 phandle3 0>;
};
To get a device_node of the node2 node you may call this:
of_parse_phandle_with_args(node4, "list", "list", 1, args);
π¦ SEE ALSO π¦
Kernel file ./drivers/of/base.c plus these SEE ALSO besties:
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_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)
π cute sign-off: source/version ./drivers/of, date October 2026, page of_parse_pha...ith_args_map(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