pinctrl_get...e_gpio_range(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… pinctrl_get_device_gpio_range(9) β€” a Kernel API Manual moment

okay so bestie, welcome to the Kernel API Manual, entry pinctrl_get...e_gpio_range(9). yes the title is abbreviated, no that's not a typo, it's just how the manpage printer does. anyway. sit down, hydrate, let's find some GPIO ranges together 🫢


✨ NAME ✨

pinctrl_get_device_gpio_range β€” find device for GPIO range

like, the whole personality of this function is "which device owns this range, bestie?" πŸ”


🌸 SYNOPSIS 🌸

int pinctrl_get_device_gpio_range (struct gpio_chip *gc , unsigned int
offset , struct pinctrl_dev **outdev , struct pinctrl_gpio_range
**outrange );

it returns an int, it takes four things, and yes you have to pass the out-params by pointer. it's giving classic kernel C, no cap πŸ’€


πŸŽ€ ARGUMENTS πŸŽ€

  • gc β€” the GPIO chip structure, straight from the GPIO subsystem. your main character struct πŸ’œ
  • offset β€” the hardware offset of the GPIO relative to the controller. like, where it sits in the lineup ✨
  • outdev β€” the pin control device, if found. key words: if found 🫢
  • outrange β€” the GPIO range, if found. same energy 🌸

πŸ¦‹ DESCRIPTION πŸ¦‹

so what it actually does: it finds the pin controller that's handling a certain GPIO pin β€” specifically from the pinspace of the GPIO subsystem β€” and then it hands you back the device and the matching GPIO range. two for one, we love to see it πŸ‘‘

and here's the caveat that matters, bestie, write it down: it returns -EPROBE_DEFER if the GPIO range could not be found in any device, since it may still have not been registered. that's not an error-error, that's a "try again later" β€” the thing literally just hasn't shown up yet 😭 so don't panic, don't refactor, just defer. periodt.


🌈 SEE ALSO 🌈

the kernel file lives at ./drivers/pinctrl/core.c β€” that's the source of truth, go read it πŸ’–

and here's the whole group chat of related functions, all of them, in order, no cap:

okay that's the whole list, i didn't skip a single one, you're welcome πŸ’…


vibe check: if you get -EPROBE_DEFER back, that is not a fail, that is the universe saying "not yet bestie." respect the defer πŸ™ˆ

and that's the page!! this little number ships out of ./drivers/pinctrl, dated October 2026, and it's part of the Kernel API Manual β€” so when you see pinctrl_get...e_gpio_range(9) in the corner, that's just the header being ✨abbreviated✨. mwah, go write some drivers πŸ’–πŸ§šβ€β™€οΈπŸŽ€

πŸ“¦ where this page comes from