of_drm_find_bridge(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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_get as soon as possible to minimize the race window, and then drm_bridge_put when you're no longer using the pointer πŸƒβ€β™€οΈπŸ’¨
  • not call drm_bridge_get or drm_bridge_put at 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_bridge control struct on success ✨
  • NULL on 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.c overview(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