spi_replace_transfers(9)
πΈ spi_replace_transfers(9) πΈ
okay bestie, welcome to the Kernel API Manual β today's main character is spi_replace_transfers, and honestly? she's kind of a big deal in the SPI world π
β¨ NAME β¨
spi_replace_transfers β the function that swaps out transfers for a whole new set of transfers (yes, plural, she's extra) and registers that change with spi_message.resources π
π¦ SYNOPSIS π¦
struct spi_replaced_transfers * spi_replace_transfers (struct
spi_message *msg , struct spi_transfer *xfer_first , size_t remove ,
size_t insert , spi_replaced_release_t release , size_t extradatasize ,
gfp_t gfp );
like, look at all those parameters. she's thorough. we respect it π
π ARGUMENTS π
msgβ thespi_messagewe're working on, aka the vibe we're operating within β¨xfer_firstβ the very firstspi_transferwe wanna replace. first one up, no cap π«Άremoveβ how many transfers to remove. bye bestie πinsertβ how many transfers we want to insert instead. hello new besties πreleaseβ extra release code that's necessary in some circumstances (iykyk) π₯extradatasizeβ extra data to allocate, and it comes with alignment guarantees ofstruct spi_transferπ―gfpβ thegfpflags, standard allocation-flavored stuff π§
β RETURN β
a pointer to spi_replaced_transfers on the happy path, or PTR_ERR(...) if things went sideways π β so like, always check before you celebrate, fr fr.
π SEE ALSO π
she travels with a whole entourage, omg. the kernel file is ./drivers/spi/spi.c and the squad is:
__spi_register_driver(9)spi_alloc_device(9)spi_add_device(9)spi_new_device(9)spi_unregister_device(9)spi_register_board_info(9)spi_res_alloc(9)spi_res_free(9)spi_res_add(9)spi_res_release(9)spi_finalize_current_transfer(9)__spi_pump_messages(9)spi_pump_messages(9)spi_take_timestamp_pre(9)spi_take_timestamp_post(9)spi_set_thread_rt(9)spi_get_next_queued_message(9)spi_finalize_current_message(9)spi_queued_transfer(9)spi_flush_queue(9)of_register_spi_devices(9)spi_new_ancillary_device(9)devm_spi_new_ancillary_device(9)acpi_spi_count_resources(9)acpi_spi_device_alloc(9)spi_target_abort(9)__spi_alloc_controller(9)__devm_spi_alloc_controller(9)spi_get_gpio_descs(9)spi_register_controller(9)devm_spi_register_controller(9)spi_unregister_controller(9)spi_split_transfers_maxsize(9)spi_split_transfers_maxwords(9)spi_set_cs_timing(9)spi_setup(9)spi_optimize_message(9)spi_unoptimize_message(9)devm_spi_optimize_message(9)spi_async(9)spi_sync(9)spi_sync_locked(9)spi_bus_lock(9)spi_bus_unlock(9)spi_write_then_read(9)
likeβ¦ that's a whole group chat, and she's the admin π π
and that's the page, bestie!! courtesy of the ./drivers/spi source, dated October 2026 β save it, screenshot it, send it to the group chat, 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