Skip to content

Commit a0071bc

Browse files
drinkcatckhu-mediatek
authored andcommitted
drm/mediatek: Only try to attach bridge if there is one
Even if dsi->bridge is NULL, we still try to call drm_bridge_attach, and print out an error message, before creating the connector. When no bridge is provided, let's skip these 2 steps and directly create the connector. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Signed-off-by: CK Hu <ck.hu@mediatek.com> Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
1 parent 6510223 commit a0071bc

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/gpu/drm/mediatek/mtk_dsi.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -818,10 +818,13 @@ static int mtk_dsi_create_conn_enc(struct drm_device *drm, struct mtk_dsi *dsi)
818818
dsi->encoder.possible_crtcs = 1;
819819

820820
/* If there's a bridge, attach to it and let it create the connector */
821-
ret = drm_bridge_attach(&dsi->encoder, dsi->bridge, NULL);
822-
if (ret) {
823-
DRM_ERROR("Failed to attach bridge to drm\n");
824-
821+
if (dsi->bridge) {
822+
ret = drm_bridge_attach(&dsi->encoder, dsi->bridge, NULL);
823+
if (ret) {
824+
DRM_ERROR("Failed to attach bridge to drm\n");
825+
goto err_encoder_cleanup;
826+
}
827+
} else {
825828
/* Otherwise create our own connector and attach to a panel */
826829
ret = mtk_dsi_create_connector(drm, dsi);
827830
if (ret)

0 commit comments

Comments
 (0)