devm_regmap_...d_bulk_alloc(9)
π
devm_regmap_...d_bulk_alloc(9) β from the Kernel API Manual, bestie
okay so first things first, the title got cut off in the header because it's long, but it's really devm_regmap_field_bulk_alloc(9) and we're gonna talk about it. pull up a chair, we're allocating register fields in bulk and the device manager is gonna clean up after us π
β¨ NAME β¨
devm_regmap_field_bulk_alloc β allocate and initialise a bulk of register fields. that's the whole vibe. πΈ
π¦ SYNOPSIS π¦
int devm_regmap_field_bulk_alloc (struct device *dev , struct regmap
*regmap , struct regmap_field **rm_field , const struct reg_field
*reg_field , int num_fields );
she takes five arguments and returns an int, no cap. π
π«Ά ARGUMENTS π«Ά
devβ the device that will be interacted with. like, who's the main character here? it's her. πregmapβ the regmap bank where this register field lives. home sweet register bank πrm_fieldβ the regmap register fields within the bank. plural energy β¨reg_fieldβ the register fields within the bank. yes, both of these. don't mix them up, i'm literally begging πnum_fieldsβ number of register fields. the count. the amount. the quantity, if you will π’
π DESCRIPTION π
so what happens? the return value is gonna be -ENOMEM on error, or zero for success β that's it, that's the deal. π«‘
but here's the iconic part: the newly allocated regmap_fields get automatically freed by the device management code. you literally don't have to do anything. the devm machinery handles it. that's the "dev" in the name, bestie, it's giving built-in cleanup π₯
ngl the whole point is you get your bulk fields and you get automatic free, so don't go manually freeing stuff you didn't ask to free, okay? π
π SEE ALSO π
source of truth: the kernel file ./drivers/base/regmap/regmap.c β go read it if you want the deep lore π
and now, the full friend group, in order, all (9) sections:
devm_regmap_field_allocregmap_field_bulk_allocregmap_field_bulk_freedevm_regmap_field_bulk_freedevm_regmap_field_freeregmap_field_allocregmap_field_freeregmap_reinit_cacheregmap_exitdev_get_regmapregmap_get_deviceregmap_can_raw_writeregmap_get_raw_read_maxregmap_get_raw_write_maxregmap_writeregmap_write_asyncregmap_raw_writeregmap_noinc_writeregmap_field_update_bits_baseregmap_field_test_bitsregmap_fields_update_bits_baseregmap_bulk_writeregmap_multi_reg_writeregmap_multi_reg_write_bypassedregmap_raw_write_asyncregmap_readregmap_read_bypassedregmap_raw_readregmap_noinc_readregmap_field_readregmap_fields_readregmap_bulk_readregmap_multi_reg_readregmap_update_bits_baseregmap_test_bitsregmap_async_completeregmap_register_patchregmap_get_val_bytesregmap_get_max_registerregmap_get_reg_strideregmap_might_sleep
forty-one of them. i counted. you're welcome π
π§ sign-off π§
kisses from ./drivers/base/regmap π dated October 2026, filed under devm_regmap_...d_bulk_alloc(9) (yes the truncation is canon, don't come for her). go allocate something slay β¨π
π
π¦ 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