of_dma_controller_register(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 a dma_chan structure. 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 to of_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