[PATCH v2 6/7] drm/vc4: dsi: stop using deprecated drmm_of_get_bridge()

Paul Cercueil paul.cercueil at bootlin.com
Thu Oct 1 01:56:44 PDT 2026


Hi Luca,

Le mardi 29 septembre 2026 à 15:39 +0200, Luca Ceresoli a écrit :
> drmm_of_get_bridge() is deprecated, switch to
> of_drm_get_bridge_by_endpoint(). As of_drm_get_bridge_by_endpoint() returns
> a refcounted bridge, ensure it is put by using bridge.next_bridge.
> 
> drm_panel.h becomes unused, drop the include.
> 
> Signed-off-by: Luca Ceresoli <luca.ceresoli at bootlin.com>
> ---
>  drivers/gpu/drm/vc4/vc4_dsi.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c
> index 0148f2befed1..30598738cfcf 100644
> --- a/drivers/gpu/drm/vc4/vc4_dsi.c
> +++ b/drivers/gpu/drm/vc4/vc4_dsi.c
> @@ -35,7 +35,6 @@
>  #include <drm/drm_edid.h>
>  #include <drm/drm_mipi_dsi.h>
>  #include <drm/drm_of.h>
> -#include <drm/drm_panel.h>
>  #include <drm/drm_print.h>
>  #include <drm/drm_probe_helper.h>
>  #include <drm/drm_simple_kms_helper.h>
> @@ -555,7 +554,6 @@ struct vc4_dsi {
>  
>  	struct platform_device *pdev;
>  
> -	struct drm_bridge *out_bridge;
>  	struct drm_bridge bridge;
>  
>  	void __iomem *regs;
> @@ -1165,7 +1163,7 @@ static int vc4_dsi_bridge_attach(struct drm_bridge
> *bridge,
>  	struct vc4_dsi *dsi = bridge_to_vc4_dsi(bridge);
>  
>  	/* Attach the panel or bridge to the dsi bridge */
> -	return drm_bridge_attach(encoder, dsi->out_bridge,
> +	return drm_bridge_attach(encoder, dsi->bridge.next_bridge,
>  				 &dsi->bridge, flags);
>  }
>  
> @@ -1749,9 +1747,9 @@ static int vc4_dsi_bind(struct device *dev, struct
> device *master, void *data)
>  		return ret;
>  	}
>  
> -	dsi->out_bridge = drmm_of_get_bridge(drm, dev->of_node, 0, 0);
> -	if (IS_ERR(dsi->out_bridge))
> -		return PTR_ERR(dsi->out_bridge);
> +	dsi->bridge.next_bridge = of_drm_get_bridge_by_endpoint(dev->of_node,
> 0, 0);
> +	if (IS_ERR(dsi->bridge.next_bridge))
> +		return PTR_ERR(dsi->bridge.next_bridge);

I had to double-check that it is fine to leave the .next_bridge field as a
pointer-encoded error. It works because drm_bridge_put() handles this case.

Reviewed-by: Paul Cercueil <paul.cercueil at bootlin.com>

Cheers,
-Paul



More information about the linux-arm-kernel mailing list