Re: [PATCH v4 1/4] drm: renesas: rz-du: rzg2l_du_encoder: convert to of_drm_find_and_get_bridge()

From: Laurent Pinchart

Date: Wed Apr 08 2026 - 17:33:46 EST


On Wed, Apr 08, 2026 at 07:39:03PM +0200, Luca Ceresoli wrote:
> On Wed Apr 8, 2026 at 5:44 PM CEST, Louis Chauvet wrote:
>
> >> @@ -83,10 +83,21 @@ int rzg2l_du_encoder_init(struct rzg2l_du_device *rcdu,
> >>
> >> bridge = devm_drm_panel_bridge_add_typed(rcdu->dev, panel,
> >> DRM_MODE_CONNECTOR_DPI);
> >> - if (IS_ERR(bridge))
> >> - return PTR_ERR(bridge);
> >> + if (IS_ERR(bridge)) {
> >> + // Inhibit the cleanup action on an ERR_PTR
> >> + ret = PTR_ERR(bridge);
> >> + bridge = NULL;
> >> + return ret;
> >> + }
> >
> > Can't you use
> > https://elixir.bootlin.com/linux/v6.19.11/source/include/linux/cleanup.h#L230?
> >
> > return PTR_ERR(no_free_ptr(bridge));
>
> Ah, nice cleanup indeed! However, being this patch already reviewed ans
> tested, I'll postpone this cleanup to a later series.

I think this modification is minor enough to keep the tags.

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@xxxxxxxxxxxxxxxx>

> > With or without this modification:
> >
> > Reviewed-by: Louis Chauvet <louis.chauvet@xxxxxxxxxxx>

--
Regards,

Laurent Pinchart