devm_gpiochip_fwd_alloc(9)
π devm_gpiochip_fwd_alloc β the Kernel API Manual moment
okay so bestie, welcome to devm_gpiochip_fwd_alloc(9) β literally the glow-up ritual where a brand-new GPIO forwarder gets born β¨ this is the Kernel API Manual entry you've been looking for, and it's giving "allocator but make it devres-managed" π«Ά
πΈ NAME πΈ
devm_gpiochip_fwd_alloc β allocate and initialize a new GPIO forwarder. that's it, that's the whole vibe: fresh forwarder, fully initialized, zero regrets π
β¨ SYNOPSIS β¨
struct gpiochip_fwd * devm_gpiochip_fwd_alloc (struct device *dev ,
unsigned int ngpios );
look at her go π two params, one pointer out, iconic behavior only π
π ARGUMENTS π
devβ the parent device pointer π«Ά this is the main character the forwarder gets attached to, no cap.ngpiosβ how many GPIOs are living inside this forwarder. yes, it's anunsigned int, and yes, you gotta count them yourself π
π₯ RETURN π₯
you get back an opaque object pointer β like, a mysterious little guy, don't ask questions β or, if things go sideways, an ERR_PTR-encoded negative error code π so fr fr, check it with IS_ERR() before you start celebrating, alright?
ngl, "opaque object pointer" is such a mood. the pointer is real, the internals are between her and the kernel π
π¦ SEE ALSO π¦
the whole friend group shows up here, and we love a supportive squad π
- Kernel file
./drivers/gpio/gpio-aggregator.c gpiochip_fwd_get_gpiochip(9)gpiochip_fwd_get_data(9)gpiochip_fwd_gpio_request(9)gpiochip_fwd_gpio_get_direction(9)gpiochip_fwd_gpio_direction_output(9)gpiochip_fwd_gpio_direction_input(9)gpiochip_fwd_gpio_get(9)gpiochip_fwd_gpio_get_multiple(9)gpiochip_fwd_gpio_set(9)gpiochip_fwd_gpio_set_multiple(9)gpiochip_fwd_gpio_set_config(9)gpiochip_fwd_gpio_to_irq(9)gpiochip_fwd_desc_add(9)gpiochip_fwd_desc_free(9)gpiochip_fwd_register(9)gpiochip_fwd_create(9)
like, seventeen whole besties. iykyk π
and that's the page, bestie π sourced straight from ./drivers/gpio, dated October 2026, and living under the devm_gpiochip_fwd_alloc(9) name forever and ever. go forth and forward those GPIOs, you absolute icon π¦β¨π
π¦ 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