mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
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 <angelogioacchino.delregno@collabora.com> Tested-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: CK Hu <ck.hu@mediatek.com> Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com> Link: https://patchwork.kernel.org/project/dri-devel/patch/20230725073234.55892-5-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
This commit is contained in:
committed by
Chun-Kuang Hu
parent
fd70e2019b
commit
214a0944e6
@@ -2552,7 +2552,9 @@ static int mtk_dp_probe(struct platform_device *pdev)
|
||||
DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID | DRM_BRIDGE_OP_HPD;
|
||||
mtk_dp->bridge.type = mtk_dp->data->bridge_type;
|
||||
|
||||
drm_bridge_add(&mtk_dp->bridge);
|
||||
ret = devm_drm_bridge_add(dev, &mtk_dp->bridge);
|
||||
if (ret)
|
||||
return dev_err_probe(dev, ret, "Failed to add bridge\n");
|
||||
|
||||
mtk_dp->need_debounce = true;
|
||||
timer_setup(&mtk_dp->debounce_timer, mtk_dp_debounce_timer, 0);
|
||||
@@ -2570,7 +2572,6 @@ static int mtk_dp_remove(struct platform_device *pdev)
|
||||
pm_runtime_put(&pdev->dev);
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
del_timer_sync(&mtk_dp->debounce_timer);
|
||||
drm_bridge_remove(&mtk_dp->bridge);
|
||||
platform_device_unregister(mtk_dp->phy_dev);
|
||||
if (mtk_dp->audio_pdev)
|
||||
platform_device_unregister(mtk_dp->audio_pdev);
|
||||
|
||||
Reference in New Issue
Block a user