STRUCT SPI_MEM_DRIVER(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 still struct spi_mem_driver(9). slay. periodt. πŸ‘‘
πŸ“¦ where this page comes from