]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm: rcar-du: encoder: convert to of_drm_find_and_get_bridge()
authorLuca Ceresoli <luca.ceresoli@bootlin.com>
Thu, 9 Apr 2026 13:23:29 +0000 (15:23 +0200)
committerLuca Ceresoli <luca.ceresoli@bootlin.com>
Thu, 16 Apr 2026 08:14:43 +0000 (10:14 +0200)
commit5b03d4907db93627ef48396f39c3455ce644c946
treeda03925f7cf3373608dc7361db92e9f569ee867e
parentad964ab629ffe5551d43f848de823814958130d5
drm: rcar-du: encoder: 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.

We need to handle the two cases: when a panel_bridge is added and when it
isn't. So:

 * in the 'else' case a panel_bridge is not added and bridge is found: use
   of_drm_find_and_get_bridge() to get a reference to the found bridge
 * in the 'then' case a panel_bridge is found using a devm function which
   already takes a refcount and will put it on removal, but we need to take
   another so the following code in this function always get exactly one
   reference that it needs to put

In order to put the reference, add the needed drm_bridge_put() calls in the
existing cleanup function.

Reviewed-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>
Link: https://patch.msgid.link/20260409-drm-bridge-alloc-getput-drm_of_find_bridge-4-v5-2-d7381c07788a@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.c
drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.h
drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c