m24lr_regmap_read(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ m24lr_regmap_read ✨

okay so bestie, welcome to the Kernel API Manual β€” this one's m24lr_regmap_read(9) and it's literally the "read it and if it doesn't work, read it again" icon we all needed πŸ’…


🌸 NAME 🌸

m24lr_regmap_read β€” read data using regmap with retry on failure πŸŽ€

So like, it reads stuff, through regmap, and if the read fails it just… tries again. Lowkey stubborn. Highkey reliable. ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

ssize_t m24lr_regmap_read (struct regmap *regmap , u8 *buf , size_t size
, unsigned int offset );

That's the whole vibe check right there πŸ‘‘


πŸ’– ARGUMENTS πŸ’–

  • regmap β€” the regmap instance for the device, aka the main character's home base 🏠
  • buf β€” buffer to store the read data, this is where the tea gets poured 🍡
  • size β€” number of bytes to read, how much tea we're pouring, fr fr
  • offset β€” starting register address, where we start pouring from πŸ“

🧚 DESCRIPTION 🧚

Okay so here's the plot: this function attempts to read a block of data from the device with retries and timeout. That's it, that's the whole thing 😭

But why, you ask? Because some M24LR chips may transiently NACK reads β€” like, for example, during internal write cycles πŸ™ˆ β€” so this function retries with a short sleep until the timeout expires. It's giving "I'll wait for you to be ready, no cap" 🫢

πŸ’€ heads up bestie: those NACKs are transient, meaning the chip is just busy doing its own internal write cycles, not broken. The retry-with-short-sleep-until-timeout is the whole strategy. Don't come for it. ✨

⭐ RETURN ⭐

  • Number of bytes read on success β€” slay, it worked πŸ’–
  • -ETIMEDOUT if the read fails within the timeout window β€” it tried, it really did, but the clock ran out 😭⏰

🌈 SEE ALSO 🌈

go read those too, iykyk πŸ‘‘πŸ”₯


πŸŽ€ and that's the page!! brought to you from ./drivers/nvmem, October 2026, in the one and only Kernel API Manual β€” stay hydrated, keep your retries short, and don't let a transient NACK ruin your whole day πŸŒΈπŸ’œπŸ¦‹

πŸ“¦ where this page comes from