of_map_id(9)
πΈ NAME πΈ
Bestie, this page is of_map_id from the Kernel API Manual (section 9, iykyk), and its whole vibe is: translate an ID through a downstream mapping. Periodt. π
β¨ SYNOPSIS β¨
Okay so hereβs the exact signature, and yes the punctuation is doing the most, so leave it alone:
int of_map_id (const struct device_node *np , u32 id , const char
*map_name , const char *cells_name , const char *map_mask_name , struct
device_node * const *filter_np , struct of_phandle_args *arg );
π ARGUMENTS π
npβ root complex device node. Thatβs the starting point, bestie.idβ device ID to map.map_nameβ property name of the map to use.cells_nameβ property name of target specifier cells.map_mask_nameβ optional property name of the mask to use.filter_npβ pointer to an optional filter node, orNULLto allow bypass. If non-NULL, the map property must exist (-ENODEVif absent). If*filter_npis also non-NULL, only entries targeting that node match. So yeah, filtering is a whole mood.argβ pointer to astruct of_phandle_argsfor the result. On success,arg->args_countwill be set to the number of output specifier cells as defined bycells_namein the target node, andarg->args[0..args_count-1]will contain the translated output specifier values. If a map entry was matched,arg->npwill be set to the target node with a reference held that the caller must release withof_node_put. Important: caller, you gotta release it. No ghosting references. π
π DESCRIPTION π
Given a device ID, look up the appropriate implementation-defined platform ID and/or the target device which receives transactions on that ID, as per the "iommu-map" and "msi-map" bindings.
Itβs literally giving βID goes in, mapped ID and/or target device comes out.β π¦
π¦ RETURN π¦
0 on success or a standard error code on failure. Slay when itβs 0, check the error code when itβs not. π
π SEE ALSO π
The whole friend group is huge, and every single one made the list. The kernel file is ./drivers/of/base.c:
- Kernel file:
./drivers/of/base.c 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_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_iommu_id(9),of_map_msi_id(9)
xoxo, your of_map_id(9) bestie π β 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