Skip to content

Commit eb8779b

Browse files
AngeloGioacchino Del RegnoChun-Kuang Hu
authored andcommitted
drm/mediatek: mtk_hdmi: Use devm managed version of drm_bridge_add
Simplify the probe/remove functions by using devm_drm_bridge_add() as now there is no more need to manually remove the bridge. Reviewed-by: CK Hu <[email protected]> Signed-off-by: AngeloGioacchino Del Regno <[email protected]> Link: https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/ Signed-off-by: Chun-Kuang Hu <[email protected]>
1 parent 89dcc9e commit eb8779b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/gpu/drm/mediatek/mtk_hdmi.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,14 +1730,15 @@ static int mtk_hdmi_probe(struct platform_device *pdev)
17301730
hdmi->bridge.type = DRM_MODE_CONNECTOR_HDMIA;
17311731
hdmi->bridge.vendor = "MediaTek";
17321732
hdmi->bridge.product = "On-Chip HDMI";
1733-
drm_bridge_add(&hdmi->bridge);
1733+
1734+
ret = devm_drm_bridge_add(dev, &hdmi->bridge);
1735+
if (ret)
1736+
return dev_err_probe(dev, ret, "Failed to add bridge\n");
17341737

17351738
ret = mtk_hdmi_clk_enable_audio(hdmi);
1736-
if (ret) {
1737-
drm_bridge_remove(&hdmi->bridge);
1739+
if (ret)
17381740
return dev_err_probe(dev, ret,
17391741
"Failed to enable audio clocks\n");
1740-
}
17411742

17421743
return 0;
17431744
}
@@ -1746,7 +1747,6 @@ static void mtk_hdmi_remove(struct platform_device *pdev)
17461747
{
17471748
struct mtk_hdmi *hdmi = platform_get_drvdata(pdev);
17481749

1749-
drm_bridge_remove(&hdmi->bridge);
17501750
mtk_hdmi_clk_disable_audio(hdmi);
17511751
}
17521752

0 commit comments

Comments
 (0)