Skip to content

Commit 95d628c

Browse files
committed
drm: rcar-du: lvds: 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. Since the companion bridge pointer is used by .atomic_enable, putting its reference in the remove function would be dangerous. Use .destroy to put it on final deallocation. Acked-by: Maxime Ripard <mripard@kernel.org> Link: https://patch.msgid.link/20260109-drm-bridge-alloc-getput-drm_of_find_bridge-3-v2-6-8d7a3dbacdf4@bootlin.com Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
1 parent 2db0d29 commit 95d628c

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

drivers/gpu/drm/renesas/rcar-du/rcar_lvds.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,13 @@ static bool rcar_lvds_mode_fixup(struct drm_bridge *bridge,
633633
return true;
634634
}
635635

636+
static void rcar_lvds_destroy(struct drm_bridge *bridge)
637+
{
638+
struct rcar_lvds *lvds = bridge_to_rcar_lvds(bridge);
639+
640+
drm_bridge_put(lvds->companion);
641+
}
642+
636643
static int rcar_lvds_attach(struct drm_bridge *bridge,
637644
struct drm_encoder *encoder,
638645
enum drm_bridge_attach_flags flags)
@@ -648,6 +655,7 @@ static int rcar_lvds_attach(struct drm_bridge *bridge,
648655

649656
static const struct drm_bridge_funcs rcar_lvds_bridge_ops = {
650657
.attach = rcar_lvds_attach,
658+
.destroy = rcar_lvds_destroy,
651659
.atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
652660
.atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
653661
.atomic_reset = drm_atomic_helper_bridge_reset,
@@ -740,7 +748,7 @@ static int rcar_lvds_parse_dt_companion(struct rcar_lvds *lvds)
740748
goto done;
741749
}
742750

743-
lvds->companion = of_drm_find_bridge(companion);
751+
lvds->companion = of_drm_find_and_get_bridge(companion);
744752
if (!lvds->companion) {
745753
ret = -EPROBE_DEFER;
746754
goto done;

0 commit comments

Comments
 (0)