devm_drm_bridge_alloc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ devm_drm_bridge_alloc(9) ✨

okay bestie, so we're in the Kernel API Manual today and the vibe is very "managed device resources, but make it fashion" πŸ’… this is devm_drm_bridge_alloc, and she's literally here to allocate and initialize a bridge for you πŸŽ€


πŸ¦‹ NAME πŸ¦‹

devm_drm_bridge_alloc β€” allocate and initialize a bridge πŸ’–


🌸 SYNOPSIS 🌸

devm_drm_bridge_alloc (dev , type , member , funcs );

like, four args, no drama, moving on 🫢


🧚 ARGUMENTS 🧚

  • dev β€” the struct device of the bridge device πŸ‘‘ that's your device, that's who she belongs to
  • type β€” the type of the struct which contains struct drm_bridge πŸ“ yes, the container struct, the one hiding the drm_bridge inside it
  • member β€” the name of the drm_bridge within type πŸ”₯ literally just the member name, so she can find it in there
  • funcs β€” callbacks for this bridge ⭐ this is where you hand over the behavior, no cap

πŸ’œ DESCRIPTION πŸ’œ

so here's the tea β˜• the reference count of the returned bridge is initialized to 1. one. that's it, that's the starting number πŸ”’

and the iconic part? that reference will be automatically dropped via devm (by calling drm_bridge_put) when dev is removed 🌈 like, you don't gotta do a thing, she cleans up after herself, main character energy fr fr πŸ’…

ngl this is the whole reason you use the devm_ version β€” the cleanup is handled for you when dev goes away, so don't go manually dropping what devm is gonna drop πŸ™ˆ

πŸ”₯ RETURN πŸ”₯

Pointer to new bridge, or ERR_PTR on failure πŸ’€ yes, ERR_PTR β€” so check that thing, bestie, don't just raw-dog the pointer 😭


πŸŽ€ SEE ALSO πŸŽ€

Kernel file ./include/drm/drm_bridge.h, plus the whole squad πŸ‘‘:

iykyk πŸ¦‹ go read the header, it's giving essential context ✨


and that's the whole page, bestie 🫢 this lil gem lives in ./include/drm, dated October 2026, and it's part of the Kernel API Manual β€” mwah, slay, periodt πŸ’–πŸŽ€πŸŒŸ

πŸ“¦ where this page comes from