Re: [PATCH v4 1/4] drm: renesas: rz-du: rzg2l_du_encoder: convert to of_drm_find_and_get_bridge()
From: Luca Ceresoli
Date: Wed Apr 08 2026 - 13:40:07 EST
Hi Louis,
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.
> With or without this modification:
>
> Reviewed-by: Louis Chauvet <louis.chauvet@xxxxxxxxxxx>
Thanks!
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com