devm_regmap_add_irq_chip(9)
π devm_regmap_add_irq_chip β the Kernel API Manual moment
okay so bestie, welcome to devm_regmap_add_irq_chip (that's the manual page name btw, it lives in the Kernel API Manual, and it's lowkey iconic). This is the resource-managed version of regmap_add_irq_chip() β meaning it handles the cleanup for you so you literally cannot forget. main character energy fr fr π
β¨ SYNOPSIS β¨
int devm_regmap_add_irq_chip (struct device *dev , struct regmap *map ,
int irq , int irq_flags , int irq_base , const struct regmap_irq_chip
*chip , struct regmap_irq_chip_data **data );
that's seven whole arguments, no cap. copy it exactly, don't freestyle π«Ά
π¦ ARGUMENTS π¦
devβ the device pointer that the irq_chip belongs to. like, whose chip is this? this one. πmapβ the regmap for the device. the vibe translator between you and the hardware.irqβ the IRQ the device uses to signal interrupts. the lil "hey notice me" ping βirq_flagsβ theIRQF_flags to use for the primary interrupt. all the flags, theIRQF_ones specifically.irq_baseβ allocate at a specific IRQ number ifirq_base > 0. only then, bestie. otherwise nah.chipβ configuration for the interrupt controller. the whole blueprint πdataβ runtime data structure for the controller, allocated on success. you get it back, it's yours β¨
πΈ DESCRIPTION πΈ
Returns 0 on success or an errno on failure. that's it, that's the whole report card π
and here's the actual slay: the regmap_irq_chip_data will be automatically released when the device is unbound. no manual freeing, no "oops I forgot", none of that. devm said I got you ππ
ngl this is the entire reason devm versions exist. you don't clean up. it cleans up. periodt.
π SEE ALSO π
- Kernel file
./drivers/base/regmap/regmap-irq.c regmap_irq_get_irq_reg_linear(9)regmap_irq_set_type_config_simple(9)regmap_add_irq_chip_fwnode(9)regmap_add_irq_chip(9)regmap_del_irq_chip(9)devm_regmap_add_irq_chip_fwnode(9)devm_regmap_del_irq_chip(9)regmap_irq_chip_get_base(9)regmap_irq_get_virq(9)regmap_irq_get_domain(9)
the whole friend group, fr β go read them too π
and that's the page! π source/version: ./drivers/base/regmap, dated October 2026, and the page is literally called devm_regmap_add_irq_chip(9). mwah, go forth and register those interrupts 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