devm_drm_bridge_alloc(9)
β¨ 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β thestruct deviceof the bridge device π that's your device, that's who she belongs totypeβ the type of the struct which containsstruct drm_bridgeπ yes, the container struct, the one hiding thedrm_bridgeinside itmemberβ the name of thedrm_bridgewithintypeπ₯ literally just the member name, so she can find it in therefuncsβ 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 thedevm_version β the cleanup is handled for you whendevgoes 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 π:
enum drm_bridge_attach_flags(9)struct drm_bridge_funcs(9)struct drm_bridge_timings(9)enum drm_bridge_ops(9)struct drm_bridge(9)drm_bridge_get_current_state(9)drm_bridge_get_next_bridge(9)drm_bridge_get_prev_bridge(9)drm_bridge_chain_get_first_bridge(9)drm_bridge_chain_get_last_bridge(9)drm_for_each_bridge_in_chain(9)drm_for_each_bridge_in_chain_from(9)
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
- 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