spi_nor_write_sr2(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… spi_nor_write_sr2 β€” the Kernel API Manual glow-up ✨

okay so bestie, welcome to spi_nor_write_sr2(9), the little kernel function whose whole entire job is writing Status Register 2. That's it. That's the vibe. πŸŽ€


🌸 NAME 🌸

spi_nor_write_sr2 β€” literally writes the Status Register 2 using the SPINOR_OP_WRSR2 (3eh) command. no cap, that's the whole assignment πŸ’–


✨ SYNOPSIS ✨

int spi_nor_write_sr2 (struct spi_nor *nor , const u8 *sr2 );

like. look at her. two args. one int coming back. iconic. πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

  • nor β€” pointer to struct spi_nor. it's giving "the flash chip's whole personality" honestly, you pass the SPI NOR struct in and she knows where she's going 🫢
  • sr2 β€” pointer to a DMA-able buffer holding the value you wanna write into Status Register 2. yes, DMA-able, don't forget that part, it's not optional bestie 😭

πŸ”₯ RETURN πŸ”₯

  • 0 on success πŸ’–
  • -errno otherwise πŸ’€ (classic kernel behavior, fr fr)

🧚 SEE ALSO 🧚

so. the guest list for this function's little party lives in the kernel file ./drivers/mtd/spi-nor/core.c, and it is LONG, so buckle up buttercup 🌈

all sixty-two of them, present and accounted for, not a single one dropped, we do not ghost functions in this house πŸ’…βœ¨


lowkey remember: sr2 has to point at a DMA-able buffer. that's not me being dramatic, that's just how it is πŸ™ˆ

okay that's the whole page bestie, go write yourself some Status Register 2 🌸 this masterclass in SPI NOR excellence comes courtesy of ./drivers/mtd/spi-nor, stamped October 2026 β€” and yes, spi_nor_write_sr2(9) is the main character of this manual, as she should be πŸ‘‘πŸ’–πŸŽ€

πŸ“¦ where this page comes from