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

Maxime Ripard mripard at kernel.org
Mon Nov 24 02:22:16 PST 2025


Hi,

On Wed, Nov 19, 2025 at 02:05:35PM +0100, Luca Ceresoli wrote:
> 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 at bootlin.com>

Kind of the same comment than on the TODO. Is it worth doing that patch
when we could just remove it at the end of the series?

> ---
>  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);

And if it does make sense to keep that patch, we should add a comment
here to document why we are doing this.

Maxime
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 273 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-amlogic/attachments/20251124/17ad3d90/attachment.sig>


More information about the linux-amlogic mailing list