STRUCT SPI_MEM_DRIVER(9)
β¨ struct_spi_mem_driver(9) β like, the whole vibe β¨
okay bestie, buckle up β this is the manual page for struct spi_mem_driver from the Kernel API Manual. yes, the kernel. we're doing big-girl systems programming today π
πΈ NAME πΈ
struct spi_mem_driver β the SPI memory driver, herself π
π SYNOPSIS π
here's the struct in all her glory, copy it exactly, no typos, she's sensitive:
struct spi_mem_driver {
struct spi_driver spidrv;
int (*probe)(struct spi_mem *mem);
int (*remove)(struct spi_mem *mem);
void (*shutdown)(struct spi_mem *mem);
};
π¦ Members π¦
spidrvβ she inherits from a SPI driver. like, that's her whole ancestry, no cap.probeβ probes a SPI memory. this is usually where the detection/initialization happens, so it's lowkey the main character of the four π«Άremoveβ removes a SPI memory. say bye πshutdownβ takes appropriate action when the system is shutdown. dramatic but necessary π
π Description π
okay so the tea β: this thing is just a thin wrapper around a spi_driver. that's it. that's the whole job.
the core takes care of allocating the spi_mem object and forwarding the probe/remove/shutdown request to the spi_mem_driver. so you don't gotta do it yourself, bestie, the core's got you π
and here's why we even bother with this wrapper (iconic design choice honestly): we might have to stuff more information into the spi_mem struct so that SPI controllers can know more about the SPI memory they interact with. having this intermediate layer lets us do exactly that β without adding a bunch of useless fields to the spi_device object. not one single wasteful field. we're minimal like that β¨
β SEE ALSO β
go read these next, iykyk:
- Kernel file
./include/linux/spi/spi-mem.h enum spi_mem_data_dir(9)struct spi_mem_op(9)struct spi_mem_dirmap_info(9)struct spi_mem_dirmap_desc(9)struct spi_mem(9)spi_mem_set_drvdata(9)spi_mem_get_drvdata(9)struct spi_controller_mem_ops(9)struct spi_controller_mem_caps(9)
and that's the whole page, bestie, you ate that π
π cute lil sign-off: this one lives at./include/linux/spi, it's dated October 2026, and yeah β the page title is stillstruct spi_mem_driver(9). slay. periodt. π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms