Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+9 -1
+9 -1
drivers/gpu/drm/renesas/rcar-du/rcar_lvds.c
··· 633 633 return true; 634 634 } 635 635 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 + 636 643 static int rcar_lvds_attach(struct drm_bridge *bridge, 637 644 struct drm_encoder *encoder, 638 645 enum drm_bridge_attach_flags flags) ··· 655 648 656 649 static const struct drm_bridge_funcs rcar_lvds_bridge_ops = { 657 650 .attach = rcar_lvds_attach, 651 + .destroy = rcar_lvds_destroy, 658 652 .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, 659 653 .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, 660 654 .atomic_reset = drm_atomic_helper_bridge_reset, ··· 748 740 goto done; 749 741 } 750 742 751 - lvds->companion = of_drm_find_bridge(companion); 743 + lvds->companion = of_drm_find_and_get_bridge(companion); 752 744 if (!lvds->companion) { 753 745 ret = -EPROBE_DEFER; 754 746 goto done;