[PATCH 04/26] drm/bridge: make of_drm_find_bridge() a wrapper of drm_of_find_bridge()

Luca Ceresoli
2025-11-19T13:06:38Z

of_drm_find_bridge() is identical to drm_of_find_bridge() except it does
not increment the refcount. Rewrite it as a wrapper and put the bridge
being returned so the behaviour is still the same.

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
drivers/gpu/drm/drm_bridge.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
index 6debbf20aaa8..09ad825f9cb8 100644
--- a/drivers/gpu/drm/drm_bridge.c
+++ b/drivers/gpu/drm/drm_bridge.c
@@ -1460,19 +1460,11 @@ EXPORT_SYMBOL(drm_of_find_bridge);
*/
struct drm_bridge *of_drm_find_bridge(struct device_node *np)
{
- struct drm_bridge *bridge;
-
- mutex_lock(&bridge_lock);
+ struct drm_bridge *bridge = drm_of_find_bridge(np);

- list_for_each_entry(bridge, &bridge_list, list) {
- if (bridge->of_node == np) {
- mutex_unlock(&bridge_lock);
- return bridge;
- }
- }
+ drm_bridge_put(bridge);

- mutex_unlock(&bridge_lock);
- return NULL;
+ return bridge;
}
EXPORT_SYMBOL(of_drm_find_bridge);
#endif

--
2.51.1