of_dma_controller_register(9)
π of_dma_controller_register(9)
okay bestie, welcome to the Kernel API Manual β yes this is a real function name and yes it has nine whole syllables, we're thriving π«Ά. This page is about of_dma_controller_register, which is the little function that tells the device tree "hey, this node right here? it's a DMA controller, pls remembeh" β¨
πΈ NAME πΈ
of_dma_controller_register β Register a DMA controller to DT DMA helpers. that's the whole vibe, no cap π
β¨ SYNOPSIS β¨
int of_dma_controller_register (struct device_node *np , struct dma_chan
*(*of_dma_xlate) (struct of_phandle_args *, struct of_dma *) , void
*data );
like, yes, that function-pointer type is giving slightly unhinged but copy it exactly, i don't make the rules π
π¦ ARGUMENTS π¦
npβ device node of DMA controller. this is literally the star of the show, the main character node πof_dma_xlateβ translation function which converts a phandle arguments list into adma_chanstructure. think of it as the translator bestie that turns weird DT speak into actual channels π§dataβ pointer to controller specific data to be used by translation function. it gets handed straight off toof_dma_xlate, so make it good π
π DESCRIPTION π
Returns 0 on success or appropriate errno value on error. so, ykno, check your return value, that's the bare minimum fr fr π
Allocated memory should be freed with appropriate of_dma_controller_free call. this is not optional, bestie β if you register and never free, that's a leak and it's giving messy π
π₯ SEE ALSO π₯
Kernel file ./drivers/dma/of-dma.c, and the whole friend group: of_dma_find_controller(9), of_dma_router_xlate(9), of_dma_controller_free(9), of_dma_router_register(9), of_dma_match_channel(9), of_dma_request_slave_channel(9), of_dma_simple_xlate(9), of_dma_xlate_by_chan_id(9). read them, they ate π
π and that's the page!! source/version: ./drivers/dma, dated October 2026 β mwah, see you in the group chat, don't forget to call of_dma_controller_free π«Άπ
π¦ 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