Skip to content

Commit 4ace6fb

Browse files
committed
drm/mediatek: mtk_hdmi*: 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 by using the drm_bridge::next_bridge pointer. Acked-by: Maxime Ripard <mripard@kernel.org> Link: https://patch.msgid.link/20260109-drm-bridge-alloc-getput-drm_of_find_bridge-3-v2-4-8d7a3dbacdf4@bootlin.com Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
1 parent 6dfebee commit 4ace6fb

4 files changed

Lines changed: 6 additions & 7 deletions

File tree

drivers/gpu/drm/mediatek/mtk_hdmi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -986,8 +986,8 @@ static int mtk_hdmi_bridge_attach(struct drm_bridge *bridge,
986986
return -EINVAL;
987987
}
988988

989-
if (hdmi->next_bridge) {
990-
ret = drm_bridge_attach(encoder, hdmi->next_bridge,
989+
if (hdmi->bridge.next_bridge) {
990+
ret = drm_bridge_attach(encoder, hdmi->bridge.next_bridge,
991991
bridge, flags);
992992
if (ret)
993993
return ret;

drivers/gpu/drm/mediatek/mtk_hdmi_common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,8 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi, struct platform_device
315315
return -EINVAL;
316316

317317
if (!of_device_is_compatible(remote, "hdmi-connector")) {
318-
hdmi->next_bridge = of_drm_find_bridge(remote);
319-
if (!hdmi->next_bridge) {
318+
hdmi->bridge.next_bridge = of_drm_find_and_get_bridge(remote);
319+
if (!hdmi->bridge.next_bridge) {
320320
dev_err(dev, "Waiting for external bridge\n");
321321
of_node_put(remote);
322322
return -EPROBE_DEFER;

drivers/gpu/drm/mediatek/mtk_hdmi_common.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ struct mtk_hdmi_conf {
150150

151151
struct mtk_hdmi {
152152
struct drm_bridge bridge;
153-
struct drm_bridge *next_bridge;
154153
struct drm_connector *curr_conn;/* current connector (only valid when 'enabled') */
155154
struct device *dev;
156155
const struct mtk_hdmi_conf *conf;

drivers/gpu/drm/mediatek/mtk_hdmi_v2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,8 +960,8 @@ static int mtk_hdmi_v2_bridge_attach(struct drm_bridge *bridge,
960960
DRM_ERROR("The flag DRM_BRIDGE_ATTACH_NO_CONNECTOR must be supplied\n");
961961
return -EINVAL;
962962
}
963-
if (hdmi->next_bridge) {
964-
ret = drm_bridge_attach(encoder, hdmi->next_bridge, bridge, flags);
963+
if (hdmi->bridge.next_bridge) {
964+
ret = drm_bridge_attach(encoder, hdmi->bridge.next_bridge, bridge, flags);
965965
if (ret)
966966
return ret;
967967
}

0 commit comments

Comments
 (0)