spi_replace_transfers(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 spi_replace_transfers(9) 🌸

okay bestie, welcome to the Kernel API Manual β€” today's main character is spi_replace_transfers, and honestly? she's kind of a big deal in the SPI world πŸ’…


✨ NAME ✨

spi_replace_transfers β€” the function that swaps out transfers for a whole new set of transfers (yes, plural, she's extra) and registers that change with spi_message.resources πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

struct spi_replaced_transfers * spi_replace_transfers (struct
spi_message *msg , struct spi_transfer *xfer_first , size_t remove ,
size_t insert , spi_replaced_release_t release , size_t extradatasize ,
gfp_t gfp );

like, look at all those parameters. she's thorough. we respect it πŸ’–


πŸ‘‘ ARGUMENTS πŸ‘‘

  • msg β€” the spi_message we're working on, aka the vibe we're operating within ✨
  • xfer_first β€” the very first spi_transfer we wanna replace. first one up, no cap 🫢
  • remove β€” how many transfers to remove. bye bestie πŸ’€
  • insert β€” how many transfers we want to insert instead. hello new besties 🌈
  • release β€” extra release code that's necessary in some circumstances (iykyk) πŸ”₯
  • extradatasize β€” extra data to allocate, and it comes with alignment guarantees of struct spi_transfer 🎯
  • gfp β€” the gfp flags, standard allocation-flavored stuff 🧚

⭐ RETURN ⭐

a pointer to spi_replaced_transfers on the happy path, or PTR_ERR(...) if things went sideways 😭 β€” so like, always check before you celebrate, fr fr.


πŸ’œ SEE ALSO πŸ’œ

she travels with a whole entourage, omg. the kernel file is ./drivers/spi/spi.c and the squad is:

like… that's a whole group chat, and she's the admin πŸ’…πŸ‘‘


and that's the page, bestie!! courtesy of the ./drivers/spi source, dated October 2026 β€” save it, screenshot it, send it to the group chat, periodt πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from