spi_nor_writ...sr_and_check(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME πŸ’…

spi_nor_write_16bit_sr_and_check β€” writes the Status Register 1 and the Status Register 2 in one single shot, bestie. It also double-checks that the byte you wrote into Status Register 1 actually matches the value that came back, and that the 16-bit Write didn't mess with whatever was already chilling in Status Register 2. ✨

(this lives in the Kernel API Manual, and no, the title up there got truncated by the man page tooling, not by me 😭)


✨ SYNOPSIS ✨

int spi_nor_write_16bit_sr_and_check (struct spi_nor *nor , u8 sr1 );

πŸŽ€ ARGUMENTS πŸŽ€

  • nor β€” pointer to a struct spi_nor. That's the NOR flash device struct, the main character of the whole operation 🫢
  • sr1 β€” byte value to be written to the Status Register 1. Just a u8, one byte, that's the vibe.

🌸 RETURN 🌸

0 on success, -errno otherwise. So if you get zero, slay πŸ”₯. If you get an -errno, something went sideways and the error code will tell you what. πŸ’€


πŸ¦‹ SEE ALSO πŸ¦‹

Okay so this function has so many cousins, lowkey a whole family reunion. All of these live in the kernel file ./drivers/mtd/spi-nor/core.c 🧚

Not me listing all 62 of them πŸ’€ but like, completeness is the whole point, periodt. πŸ‘‘


Real talk: all of those references point at the SPI-NOR core stuff in the kernel source at ./drivers/mtd/spi-nor, so if you wanna go read the actual code, that's where the party is at πŸ”₯

./drivers/mtd/spi-nor β€’ October 2026 β€’ spi_nor_writ...sr_and_check(9) β€” mwah, that's the page, hope it ate πŸ’–πŸŒˆβ­

πŸ“¦ where this page comes from