devm_regmap_...d_bulk_alloc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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_alloc
  • regmap_field_bulk_alloc
  • regmap_field_bulk_free
  • devm_regmap_field_bulk_free
  • devm_regmap_field_free
  • regmap_field_alloc
  • regmap_field_free
  • regmap_reinit_cache
  • regmap_exit
  • dev_get_regmap
  • regmap_get_device
  • regmap_can_raw_write
  • regmap_get_raw_read_max
  • regmap_get_raw_write_max
  • regmap_write
  • regmap_write_async
  • regmap_raw_write
  • regmap_noinc_write
  • regmap_field_update_bits_base
  • regmap_field_test_bits
  • regmap_fields_update_bits_base
  • regmap_bulk_write
  • regmap_multi_reg_write
  • regmap_multi_reg_write_bypassed
  • regmap_raw_write_async
  • regmap_read
  • regmap_read_bypassed
  • regmap_raw_read
  • regmap_noinc_read
  • regmap_field_read
  • regmap_fields_read
  • regmap_bulk_read
  • regmap_multi_reg_read
  • regmap_update_bits_base
  • regmap_test_bits
  • regmap_async_complete
  • regmap_register_patch
  • regmap_get_val_bytes
  • regmap_get_max_register
  • regmap_get_reg_stride
  • regmap_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