devm_mfd_add_devices(9)
π devm_mfd_add_devices(9)
okay so bestie, welcome to the Kernel API Manual β today's main character is devm_mfd_add_devices, and honestly? she's giving "resource manager energy" and we're obsessed β¨
πΈ NAME
devm_mfd_add_devices β the resource managed version of mfd_add_devices() π
like, same vibes as the original, but the kernel cleans up after you so you don't have to. no cap.
π¦ SYNOPSIS
int devm_mfd_add_devices (struct device *dev , int id , const struct
mfd_cell *cells , int n_devs , struct resource *mem_base , int irq_base
, struct irq_domain *domain );
β¨ ARGUMENTS
devβ pointer to the parent device. the momager of this whole situation πidβ can bePLATFORM_DEVID_AUTOto let the Platform API take care of device numbering for you (slay, delegation), or it gets added to a device'scell_id. your call, bestie πcellsβ array of(struct mfd_cell)s describing the child devices. every child gets a little description card πn_devsβ the number of child devices to register. count 'em π’mem_baseβ parent register range resource for the child devices πΊοΈirq_baseβ base of the range of virtual interrupt numbers allocated for this MFD device. unused ifdomainis specified β οΈ so like, don't bother, iykykdomainβ the interrupt domain to create mappings for hardware interrupts for π§ββοΈ
π₯ DESCRIPTION
Returns 0 on success, or an appropriate negative error number on failure. that's it, that's the vibe check π
And the iconic part: all child devices of the MFD will automatically be removed when it gets unbinded π«Ά literally no manual cleanup, the devm_ prefix is doing the work for you, periodt.
π SEE ALSO
- Kernel file
./drivers/mfd/mfd-core.c mfd_add_devices(9)
and that's the whole page, bestie!! π source/version: ./drivers/mfd Β· dated October 2026 Β· devm_mfd_add_devices(9) β go forth and register those child devices πβ¨
π¦ 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