]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/bridge: drm_bridge_put(): ignore ERR_PTR
authorLuca Ceresoli <luca.ceresoli@bootlin.com>
Mon, 11 May 2026 16:40:05 +0000 (18:40 +0200)
committerLuca Ceresoli <luca.ceresoli@bootlin.com>
Tue, 19 May 2026 08:57:25 +0000 (10:57 +0200)
commit55bb2b137b6d72b3281f70045d9ee5a087df0aa4
treeddbb41541dcff53c484b5ab91d3e9705048bc0df
parentb11a6cea91f2cec688936d591548bc5c1540c648
drm/bridge: drm_bridge_put(): ignore ERR_PTR

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 as an ERR_PTR 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_put()
ignore ERR_PTR values, just like it ignores NULL pointers.

This will avoid annoying error checking in many places and the risk of
missing error checks.

Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/all/20260318152533.GA633439@killaraus.ideasonboard.com/
Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/all/omlnswxukeqgnatzdvooaashgkfcacjevkvbkm6xt33itgua2k@jcmzll2w6kdq/
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Link: https://patch.msgid.link/20260511-drm-bridge-alloc-getput-panel_or_bridge-v6-1-f61c9e498b3f@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
drivers/gpu/drm/drm_bridge.c