of_drm_find_bridge(9)
π NAME
okay so bestie, meet of_drm_find_bridge β the Kernel API Manual page for it, fr fr. What does it do? It finds the bridge that corresponds to a given device node, looking through the global bridge list. cute concept, slightly cursed execution (more on that in a sec π«£)
β¨ SYNOPSIS
struct drm_bridge * of_drm_find_bridge (struct device_node *np );
π ARGUMENTS
npβ the device node. that's it. that's the whole input. she takes one (1) device node and goes looking π
π¦ DESCRIPTION
okay so listen. This function is deprecated. like, officially. no cap. the glow-up you want is of_drm_find_and_get_bridge β convert to that instead, because it does proper refcounting and refcounting is the whole vibe. π
here's the tea: the bridge that this function hands back is not refcounted. and that's genuinely dangerous, not like "oops spilled my matcha" dangerous β the bridge might literally get deallocated even before the caller has a chance to use it. like you got handed the aux cord and the car got towed mid-song π
so if you're gonna use this function anyway, you have to do one of these three things:
- get a reference with
drm_bridge_getas soon as possible to minimize the race window, and thendrm_bridge_putwhen you're no longer using the pointer πββοΈπ¨ - not call
drm_bridge_getordrm_bridge_putat all β which, lowkey, used to be the correct practice before dynamic bridge lifetime was introduced (yes, that's how old this pattern is π) - again... convert to
of_drm_find_and_get_bridge, which is the only safe thing to do. periodt. π
bestie I'm begging you. option three. it's giving self-care. it's giving not-crashing-in-production. π«Ά
πΈ RETURN
- the
drm_bridgecontrol struct on success β¨ NULLon failure π
that's the whole return contract, no surprises, we love a simple signature.
β SEE ALSO
the whole group chat, in order:
- Kernel file
./drivers/gpu/drm/drm_bridge.coverview(9) - display driver integration(9)
- special care dsi(9)
- dsi bridge operations(9)
- bridge chain format selection(9)
drm_bridge_enter(9)drm_bridge_exit(9)drm_bridge_unplug(9)drm_bridge_get(9)drm_bridge_put(9)drm_bridge_clear_and_put(9)drm_bridge_put_void(9)drm_bridge_add(9)devm_drm_bridge_add(9)drm_bridge_remove(9)drm_bridge_attach(9)- bridge operations(9)
drm_bridge_chain_mode_valid(9)drm_bridge_chain_mode_set(9)drm_atomic_bridge_chain_disable(9)drm_atomic_bridge_chain_post_disable(9)drm_atomic_bridge_chain_pre_enable(9)drm_atomic_bridge_chain_enable(9)drm_atomic_bridge_chain_check(9)drm_bridge_detect(9)drm_bridge_get_modes(9)drm_bridge_edid_read(9)drm_bridge_hpd_enable(9)drm_bridge_hpd_disable(9)drm_bridge_hpd_notify(9)of_drm_find_and_get_bridge(9)of_drm_get_bridge_by_endpoint(9)devm_drm_put_bridge(9)
and that's the page!! π¦ mwah π she lives in ./drivers/gpu/drm, she was dated October 2026, and she's filed under of_drm_find_bridge(9) β go read the safe one instead, ily, bye πβ¨
π¦ 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