acpi_spi_device_alloc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– acpi_spi_device_alloc πŸ’–

okay so this is a page from the Kernel API Manual, and today's main character is acpi_spi_device_alloc(9) β€” the little function that hands you a fresh SPI device already dressed up in its ACPI info. slay.


✨ NAME ✨

acpi_spi_device_alloc β€” allocate a spi device, and fill it in with ACPI information πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

struct spi_device * acpi_spi_device_alloc (struct spi_controller *ctlr ,
struct acpi_device *adev , int index );

🌸 ARGUMENTS 🌸

  • ctlr β€” the controller that this spi device belongs to. it's giving "who's your parent" energy πŸ’…
  • adev β€” the ACPI Device for the spi device. the source of all the lore ✨
  • index β€” the index of the spi resource inside the ACPI Node. like, which one bestie 🫢

πŸ’œ DESCRIPTION πŸ’œ

okay so here's the vibe: you use this to allocate a new SPI device from and ACPI Device node. yes, "from and" β€” that's what the page says, we don't edit the original text's quirks, we respect them πŸ™ˆ

the caller is responsible for calling spi_add_device to register the SPI device. you, bestie. that's on you. no cap. πŸ”₯

if ctlr is set to NULL, the Controller for the SPI device will be looked up using the resource. it'll figure itself out, main character energy ⭐

if index is set to -1, index is not used. it's just there vibing. πŸ’€


⚠️ NOTE ⚠️

if index is -1, then ctlr must be set. lowkey non-negotiable. don't come crying to me when it breaks 😭

πŸ‘‘ RETURN πŸ‘‘

a pointer to the new device, or ERR_PTR on error. so like, check it. please. for me. πŸ₯Ί


🌈 SEE ALSO 🌈

this list is long but every single one of them ate, so here we go, no skipping, hydrate first bestie πŸ“

iykyk 🧚


okay that's the whole page, we're done here πŸ’… this little number lives in ./drivers/spi, it's stamped October 2026, and it answers to the name acpi_spi_device_alloc(9). mwah, go read the source, bye bestie πŸ«ΆπŸ’–βœ¨

πŸ“¦ where this page comes from