devm_spi_reg...r_controller(9)
π devm_spi_reg...r_controller(9) β like, the managed SPI registration one π
okay so welcome to the Kernel API Manual bestie, this is the page for devm_spi_register_controller(9) and it is genuinely so useful, stay with me π
β¨ NAME β¨
devm_spi_register_controller β register a managed SPI host or target controller π¦
πΈ SYNOPSIS πΈ
int devm_spi_register_controller (struct device *dev , struct
spi_controller *ctlr );
β ARGUMENTS β
devβ the device that's managing the SPI controller, i.e. the one holding the leash π«Άctlrβ the initialized controller. and like, "initialized" is doing heavy lifting here β it originally comes fromspi_alloc_hostorspi_alloc_target, no cap π₯
π CONTEXT π
can sleep π΄ β yes queen, this one is allowed to nap, so don't you dare call it from atomic context
π DESCRIPTION π
So basically it registers a SPI device exactly like spi_register_controller does, except β and this is the iconic part β it's managed, meaning it will automatically be unregistered for you. devm ate and left no crumbs, you literally don't have to clean up π
π RETURN π
zeroon success π- else a negative error code π (negative = something went wrong, obviously)
π§ SEE ALSO π§
Kernel file ./drivers/spi/spi.c β go read it, it's giving main character energy π
__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)spi_unregister_controller(9)spi_replace_transfers(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)
and that's the whole page bestie, ily, go write some kernel code π«Άβ¨
little sign-off from the source: this one lives under ./drivers/spi, dated October 2026 β mwah, 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