]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/omap: dss: convert to of_drm_find_and_get_bridge()
authorLuca Ceresoli <luca.ceresoli@bootlin.com>
Thu, 2 Apr 2026 16:27:20 +0000 (18:27 +0200)
committerLuca Ceresoli <luca.ceresoli@bootlin.com>
Thu, 9 Apr 2026 12:38:08 +0000 (14:38 +0200)
commit0a7f39ba3ffcb810150d95237ee4e089fa522a93
tree328c7cf183fe64107348e8b019370d07f048ca2e
parentabbe7f8144d532354723dd1c5ab0daf41aa9706e
drm/omap: dss: convert to of_drm_find_and_get_bridge()

of_drm_find_bridge() is deprecated. Move to its replacement
of_drm_find_and_get_bridge() which gets a bridge reference, and ensure it
is put when done.

omapdss_device_init_output() can take one bridge pointer in out->bridge or
two pointers in out->bridge and out->next_bridge. Ensure each has a
corresponding drm_bridge_get() and add drm_bridge_put() calls in the
cleanup code.

Also slightly change the initial code assigning out->panel and out->bridge
to ensure and clarify that either out->panel or out->bridge is set in the
function prologue, not both. If both were set, the 'if (out->panel){...}'
code that follows would overwrite out->bridge without having put the
reference.

Finally, take a reference in case a panel_bridge is added using
drm_panel_bridge_add(). This ensures we always need to put a reference,
which came either from of_drm_find_and_get_bridge() or by the
drm_panel_bridge_add+drm_bridge_get() branch.

Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260402-drm-bridge-alloc-getput-drm_of_find_bridge-4-v4-4-421781c8c061@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
drivers/gpu/drm/omapdrm/dss/output.c