spi_mem_poll_status(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ spi_mem_poll_status(9) ✨

okay so this is a page straight out of the Kernel API Manual, and it's giving "waiting for your friend to text back but make it silicon" πŸ’… buckle up bestie, we're polling a status register.


🌸 NAME 🌸

spi_mem_poll_status β€” poll memory device status. that's it, that's the whole vibe. it checks on your memory device until it's ready or until it gives up 😭


πŸŽ€ SYNOPSIS πŸŽ€

int spi_mem_poll_status (struct spi_mem *mem , const struct spi_mem_op
*op , u16 mask , u16 match , unsigned long initial_delay_us , unsigned
long polling_delay_us , u16 timeout_ms );

like, seven arguments. seven. she's high-maintenance and we respect it πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

  • mem β€” the SPI memory device itself. the main character fr.
  • op β€” the memory operation to execute. the whole reason we're here.
  • mask β€” status bitmask to ckeck (yes, ckeck, that's literally how it's spelled in here, we love a typo, no notes πŸ™ˆ). it's the bits you care about.
  • match β€” the (status & mask) expected value. the answer you're waiting for πŸ’–
  • initial_delay_us β€” delay in us before starting to poll. a little beauty rest first, iconic.
  • polling_delay_us β€” time to sleep between reads in us. the nap between check-ins 😴
  • timeout_ms β€” timeout in milliseconds. the point where we simply stop waiting, bestie ⏰

πŸ’œ DESCRIPTION πŸ’œ

This function polls a status register and returns when (status & mask) == match or when the timeout has expired. that's the whole plot: keep peeking at the status register, and the second the masked bits match what you expected β€” you're done, slay πŸŽ‰ If the timeout runs out first, it also returns. no infinite loops, periodt.


πŸ”₯ RETURN πŸ”₯

  • 0 in case of success β€” ate, no crumbs πŸ’…
  • -ETIMEDOUT in case of error β€” the timeout expired, we waited too long, tragic 😭
  • -EOPNOTSUPP if not supported β€” this device said "not today", don't take it personally

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/spi/spi-mem.c

like a whole friend group of SPI functions, and yes they all said hi 🫢


okay that's the page!! this one lives in ./drivers/spi, dated October 2026, and it's titled spi_mem_poll_status(9) in case you forgot where you were πŸ’– go poll something responsibly, ily, bye πŸ§šβ€β™€οΈπŸŒˆβ­

πŸ“¦ where this page comes from