]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/bridge: add devm_drm_put_bridge()
authorLuca Ceresoli <luca.ceresoli@bootlin.com>
Fri, 9 May 2025 13:53:46 +0000 (15:53 +0200)
committerLuca Ceresoli <luca.ceresoli@bootlin.com>
Wed, 21 May 2025 11:40:09 +0000 (13:40 +0200)
commit5164553d739ef45b2c69c8cfe88b9ef26c9a0035
tree0bdbf1a41170ace45d65d6d577e36a08469a0fe2
parentafb903c01b2b7af382392024fb02bbfea62696f7
drm/bridge: add devm_drm_put_bridge()

Bridges obtained via devm_drm_bridge_alloc(dev, ...) will be put when the
requesting device (@dev) is removed.

However drivers which obtained them may need to put the obtained reference
explicitly. One such case is if they bind the devm removal action to a
different device than the one implemented by the driver itself and which
might be removed at a different time, such as bridge/panel.c.

Add devm_drm_put_bridge() to manually release a devm-obtained bridge in
such cases.

This function is considered only a temporary workaround until the panel
bridge is reworked and should be removed afterwards.

Acked-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250509-drm-bridge-convert-to-alloc-api-v3-20-b8bc1f16d7aa@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
drivers/gpu/drm/drm_bridge.c
include/drm/drm_bridge.h