devm_pinctrl...ter_mappings(9)
π 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__initdatathat 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 anunsigned intπ’
β RETURN β
0if it ate and everything worked π- a negative
errnoif 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:
pinctrl_provide_dummies(9)get_pinctrl_dev_from_devname(9)pin_get_from_name(9)pin_get_name(9)gpio_to_pin(9)pinctrl_match_gpio_range(9)pinctrl_ready_for_gpio_range(9)pinctrl_get_device_gpio_range(9)pinctrl_add_gpio_range(9)pinctrl_find_gpio_range_from_pin(9)pinctrl_remove_gpio_range(9)pinctrl_generic_get_group_count(9)pinctrl_generic_get_group_name(9)pinctrl_generic_get_group_pins(9)pinctrl_generic_get_group(9)pinctrl_generic_add_group(9)pinctrl_generic_remove_group(9)pinctrl_generic_free_groups(9)pinctrl_get_group_selector(9)pinctrl_gpio_request(9)pinctrl_gpio_free(9)pinctrl_gpio_direction_input(9)pinctrl_gpio_direction_output(9)pinctrl_gpio_set_config(9)pinctrl_gpio_get_config(9)pinctrl_get(9)pinctrl_release(9)pinctrl_put(9)pinctrl_lookup_state(9)pinctrl_commit_state(9)pinctrl_select_state(9)devm_pinctrl_get(9)devm_pinctrl_put(9)pinctrl_register_mappings(9)pinctrl_unregister_mappings(9)pinctrl_force_sleep(9)pinctrl_force_default(9)pinctrl_init_done(9)pinctrl_select_default_state(9)pinctrl_pm_select_default_state(9)pinctrl_pm_select_init_state(9)pinctrl_pm_select_sleep_state(9)pinctrl_pm_select_idle_state(9)pinctrl_init_controller(9)pinctrl_register(9)pinctrl_register_and_init(9)pinctrl_unregister(9)devm_pinctrl_register(9)devm_pinctrl_register_and_init(9)
yeah that's a lot of friends. iykyk. π¦
π tiny recap so it sticks: use this when you wantpinctrl_register_mappings()energy but with automatic devres cleanup. keep yourmapstable alive (no__initdata!), pass the rightnum_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
- 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