of_map_id(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 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, or NULL to allow bypass. If non-NULL, the map property must exist (-ENODEV if absent). If *filter_np is also non-NULL, only entries targeting that node match. So yeah, filtering is a whole mood.
  • arg β€” pointer to a struct of_phandle_args for the result. On success, arg->args_count will be set to the number of output specifier cells as defined by cells_name in the target node, and arg->args[0..args_count-1] will contain the translated output specifier values. If a map entry was matched, arg->np will be set to the target node with a reference held that the caller must release with of_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:

xoxo, your of_map_id(9) bestie πŸ’– β€” source/version: ./drivers/of 🌈 date: October 2026 πŸŽ€

πŸ“¦ where this page comes from