regmap_field_test_bits(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… regmap_field_test_bits(9) β€” the Kernel API Manual, bestie edition πŸŽ€

okay so real talk, we're in the Kernel API Manual today and the star of the show is regmap_field_test_bits(9). yes it's a whole mouthful, no you don't have to say it out loud, but you do have to understand it. it's giving "small function, big feelings" and honestly? iconic.


✨ NAME ✨

regmap_field_test_bits β€” bestie's little vibe check for a register field: it checks whether all the bits you asked about are actually set. πŸ¦‹


🌸 SYNOPSIS 🌸

int regmap_field_test_bits (struct regmap_field *field , unsigned int bits );

like, that's it. that's the whole signature. two args, one int coming back at you. slay. πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • field β€” the register field we're operating on. the main character, if you will. πŸ‘‘
  • bits β€” the bits you wanna test. the little squad you're checking on. ⭐

πŸ’– DESCRIPTION πŸ’–

so here's the tea β˜• β€” this function gives you a tri-state answer and honestly it ate:

  • it returns a negative errno if the underlying regmap_field_read fails. like, the read itself flopped. 😭
  • it returns 0 if at least one of the tested bits is not set. so like, close but not all of them showed up to the party. πŸ’€
  • it returns 1 if all tested bits are set. full squad present, everyone slayed. πŸ”₯

ngl that's a lot of meaning packed into one little int, and that's exactly why we respect it. no cap. 🫢

lowkey important: it's all-or-nothing on the 1. one missing bit and you're getting a 0. that's the vibe check, and it is strict. ✨

🌈 SEE ALSO 🌈

okay this list is LONG, like genuinely a whole group chat of related functions, so let's get through it together. this is the Kernel file ./drivers/base/regmap/regmap.c crew πŸ‘‡

that's the whole roster, nobody left out, we don't do that here πŸ’œ


and that's the page!! this lil masterpiece lives in ./drivers/base/regmap and it's from the Kernel API Manual, dated October 2026 β€” go off, you absolute legend πŸ§šβ€β™€οΈπŸ’…βœ¨πŸ“

πŸ“¦ where this page comes from