Skip to content

Commit 0384833

Browse files
robclarkdianders
authored andcommitted
drm/bridge: sn65dsi86: defer if there is no dsi host
Otherwise we don't get another shot at it if the bridge probes before the dsi host is registered. It seems like this is what *most* (but not all) of the other bridges do. It looks like this was missed in the conversion to attach dsi host at probe time. Fixes: c3b75d4 ("drm/bridge: sn65dsi86: Register and attach our DSI device at probe") Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Doug Anderson <[email protected]> Tested-by: Doug Anderson <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> [dianders: squashed in Stephen's simplification] Signed-off-by: Douglas Anderson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent d6c75c2 commit 0384833

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

drivers/gpu/drm/bridge/ti-sn65dsi86.c

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ static struct ti_sn65dsi86 *bridge_to_ti_sn65dsi86(struct drm_bridge *bridge)
704704

705705
static int ti_sn_attach_host(struct ti_sn65dsi86 *pdata)
706706
{
707-
int ret, val;
707+
int val;
708708
struct mipi_dsi_host *host;
709709
struct mipi_dsi_device *dsi;
710710
struct device *dev = pdata->dev;
@@ -714,16 +714,12 @@ static int ti_sn_attach_host(struct ti_sn65dsi86 *pdata)
714714
};
715715

716716
host = of_find_mipi_dsi_host_by_node(pdata->host_node);
717-
if (!host) {
718-
DRM_ERROR("failed to find dsi host\n");
719-
return -ENODEV;
720-
}
717+
if (!host)
718+
return -EPROBE_DEFER;
721719

722720
dsi = devm_mipi_dsi_device_register_full(dev, host, &info);
723-
if (IS_ERR(dsi)) {
724-
DRM_ERROR("failed to create dsi device\n");
721+
if (IS_ERR(dsi))
725722
return PTR_ERR(dsi);
726-
}
727723

728724
/* TODO: setting to 4 MIPI lanes always for now */
729725
dsi->lanes = 4;
@@ -739,13 +735,7 @@ static int ti_sn_attach_host(struct ti_sn65dsi86 *pdata)
739735

740736
pdata->dsi = dsi;
741737

742-
ret = devm_mipi_dsi_attach(dev, dsi);
743-
if (ret < 0) {
744-
DRM_ERROR("failed to attach dsi to host\n");
745-
return ret;
746-
}
747-
748-
return 0;
738+
return devm_mipi_dsi_attach(dev, dsi);
749739
}
750740

751741
static int ti_sn_bridge_attach(struct drm_bridge *bridge,
@@ -1267,8 +1257,10 @@ static int ti_sn_bridge_probe(struct auxiliary_device *adev,
12671257
drm_bridge_add(&pdata->bridge);
12681258

12691259
ret = ti_sn_attach_host(pdata);
1270-
if (ret)
1260+
if (ret) {
1261+
dev_err_probe(pdata->dev, ret, "failed to attach dsi host\n");
12711262
goto err_remove_bridge;
1263+
}
12721264

12731265
return 0;
12741266

0 commit comments

Comments
 (0)