[PATCH v4 01/11] drm/bridge: drm_bridge_get/put(): ignore ERR_PTR
Luca Ceresoli
luca.ceresoli at bootlin.com
Mon May 4 07:13:32 PDT 2026
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
More information about the linux-arm-kernel
mailing list