This driver obtains a bridge pointer from of_drm_find_bridge() in the probe
function and stores it until driver removal. of_drm_find_bridge() is
deprecated. Move to devm_of_drm_get_bridge() which puts the bridge
reference on remove or on probe failure.
Note: this driver stores the bridge pointer in the adv_bridge global
variable, which could hold a value from a previous probe. However the code
flow always sets the adv_bridge value in the probe function before it is
read, so the change is safe.
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
drivers/gpu/drm/kmb/kmb_dsi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/kmb/kmb_dsi.c b/drivers/gpu/drm/kmb/kmb_dsi.c
index faf38ca9e44c..0a69e91aa136 100644
--- a/drivers/gpu/drm/kmb/kmb_dsi.c
+++ b/drivers/gpu/drm/kmb/kmb_dsi.c
@@ -251,7 +251,7 @@ int kmb_dsi_host_bridge_init(struct device *dev)
return -EINVAL;
}
/* Locate drm bridge from the hdmi encoder DT node */
- adv_bridge = of_drm_find_bridge(encoder_node);
+ adv_bridge = devm_of_drm_get_bridge(dev, encoder_node);
of_node_put(dsi_out);
of_node_put(encoder_node);
if (!adv_bridge) {
--
2.51.1