Subject: Re: [PATCH v4 01/11] drm/bridge: drm_bridge_get/put(): ignore ERR_PTR

From: "Luca Ceresoli" <[email-masked]>
Date: Mon, 04 May 2026 16:13:32 +0200

Hi Laurent,

On Mon May 4, 2026 at 3:53 PM CEST, Laurent Pinchart wrote:
> On Mon, May 04, 2026 at 12:45:04PM +0200, Luca Ceresoli wrote:
>> Most functions returning a struct drm_bridge pointer currently return a
>> valid pointer or NULL, but this restricts their ability to return an error
>> code describing the error kind.
>>
>> In preparation to have new APIs that can return a struct drm_bridge pointer
>> holding an ERR_PTR (and for those which already do) make drm_bridge_get()
>> and drm_bridge_put() ignore ERR_PTR values, just like they ignore NULL
>> pointers.
>
> The change in drm_bridge_put() looks good to me. I'm less sure about
> drm_bridge_get(), is there a valid use case to call get() on a bridge
> that is not valid ? Doesn't it indicate a clear error in the caller ?

Good point. Indeed I don't have a valid use case in mind.

I guess I can drop the drm_bridge_get() and send v5. Should there be a
valid use case it will emerge at some point and this can be rediscussed.

Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com