spi_mem_dirmap_create(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… spi_mem_dirmap_create(9) β€” a Kernel API Manual moment ✨

okay so bestie, welcome to the group chat that is the Kernel API Manual, and today's main character is spi_mem_dirmap_create πŸŽ€ no cap, this one's a baddie.


🌸 NAME 🌸

spi_mem_dirmap_create β€” create a direct mapping descriptor πŸ’«


✨ SYNOPSIS ✨

struct spi_mem_dirmap_desc * spi_mem_dirmap_create (struct spi_mem *mem
, const struct spi_mem_dirmap_info *info );

like, look at that signature. it's giving "i know exactly what i'm doing." 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • mem β€” the SPI mem device this direct mapping should be created for. literally the whole reason we're here πŸ’–
  • info β€” the direct mapping information. all the little deets πŸ“‹

🌈 DESCRIPTION 🌈

okay so this function is out here creating a direct mapping descriptor, and that descriptor can then be used to access the memory via spi_mem_dirmap_read or spi_mem_dirmap_write. iconique behavior, honestly πŸ‘‘

and here's the part that ate: if the SPI controller driver does not support direct mapping, this function falls back to an implementation using spi_mem_exec_op β€” so the caller doesn't have to bother implementing a fallback on their own. like?? it did that so you didn't have to πŸ˜­πŸ’… considerate king energy fr fr.


⭐ RETURN ⭐

  • a valid pointer in case of success πŸŽ‰
  • ERR_PTR otherwise πŸ’€
bestie, always check your pointers. this is not a drill. πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

the kernel file, living over at ./drivers/spi/spi-mem.c πŸ—‚οΈ

and the whole friend group:


and that's the tea β˜• this page lives in ./drivers/spi, dated October 2026, and it's spi_mem_dirmap_create(9) forever and ever 🌟 mwah πŸ’‹ go read your docs bestie, ily πŸ§šπŸ’œ

πŸ“¦ where this page comes from