devm_pinctrl...ter_mappings(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… devm_pinctrl...ter_mappings(9) β€” from the Kernel API Manual, bestie πŸŽ€

okay so real talk, this one is a resource-managed version of pinctrl_register_mappings(). that's the whole vibe. it registers your pincontrol mappings but ties them to a struct device * so the kernel cleans up after you automatically, like the world's most responsible bestie. no cap. ✨


🌸 SYNOPSIS 🌸

int devm_pinctrl_register_mappings (struct device *dev , const struct
       pinctrl_map *maps , unsigned int num_maps );

like literally that's the whole call. three args. go off. πŸ’…


✨ ARGUMENTS ✨

  • dev β€” the device you're registering these mappings for. this is the devres hookup, the whole reason we're here 🫢
  • maps β€” the pincontrol mappings table you want to register. πŸ—ΊοΈ but listen, and i'm being so serious right now: the pinctrl-core keeps a reference to the maps you passed in, so they should _not_ be marked with __initdata. do not do it. i'm begging. 😭 if you __initdata that table it gets freed and then the core is holding a pointer to vibes and dust. πŸ’€
  • num_maps β€” how many mappings are actually in that table, as an unsigned int πŸ”’

⭐ RETURN ⭐

  • 0 if it ate and everything worked πŸŽ‰
  • a negative errno if it did not πŸ˜”

that's it, that's the contract. no surprises, and honestly? we love a clean return.


🌈 SEE ALSO 🌈

kernel file ./drivers/pinctrl/core.c β€” go read it, it's giving main character energy πŸ‘‘

and the whole extended friend group, in the order the page lists them:

yeah that's a lot of friends. iykyk. πŸ¦‹


πŸ’– tiny recap so it sticks: use this when you want pinctrl_register_mappings() energy but with automatic devres cleanup. keep your maps table alive (no __initdata!), pass the right num_maps, and check that return value. mwah. 🫢

that's the whole page, bestie β€” straight from ./drivers/pinctrl, dated October 2026, and the manual it lives in is the Kernel API Manual. go forth and register those mappings responsibly. πŸ§šβ€β™€οΈβœ¨

πŸ“¦ where this page comes from