Skip to content

Commit 214a094

Browse files
AngeloGioacchino Del RegnoChun-Kuang Hu
authored andcommitted
drm/mediatek: dp: Use devm variant of drm_bridge_add()
In preparation for adding support for aux-bus, which will add a code path that may fail after the drm_bridge_add() call, change that to devm_drm_bridge_add() to simplify failure paths later. Signed-off-by: AngeloGioacchino Del Regno <[email protected]> Tested-by: Chen-Yu Tsai <[email protected]> Reviewed-by: CK Hu <[email protected]> Reviewed-by: Alexandre Mergnat <[email protected]> Link: https://patchwork.kernel.org/project/dri-devel/patch/[email protected]/ Signed-off-by: Chun-Kuang Hu <[email protected]>
1 parent fd70e20 commit 214a094

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/gpu/drm/mediatek/mtk_dp.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2552,7 +2552,9 @@ static int mtk_dp_probe(struct platform_device *pdev)
25522552
DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID | DRM_BRIDGE_OP_HPD;
25532553
mtk_dp->bridge.type = mtk_dp->data->bridge_type;
25542554

2555-
drm_bridge_add(&mtk_dp->bridge);
2555+
ret = devm_drm_bridge_add(dev, &mtk_dp->bridge);
2556+
if (ret)
2557+
return dev_err_probe(dev, ret, "Failed to add bridge\n");
25562558

25572559
mtk_dp->need_debounce = true;
25582560
timer_setup(&mtk_dp->debounce_timer, mtk_dp_debounce_timer, 0);
@@ -2570,7 +2572,6 @@ static int mtk_dp_remove(struct platform_device *pdev)
25702572
pm_runtime_put(&pdev->dev);
25712573
pm_runtime_disable(&pdev->dev);
25722574
del_timer_sync(&mtk_dp->debounce_timer);
2573-
drm_bridge_remove(&mtk_dp->bridge);
25742575
platform_device_unregister(mtk_dp->phy_dev);
25752576
if (mtk_dp->audio_pdev)
25762577
platform_device_unregister(mtk_dp->audio_pdev);

0 commit comments

Comments
 (0)