Commit 648ce7fd authored by Jagan Teki's avatar Jagan Teki Committed by Philippe Cornu

drm/stm: ltdc: Silence -EPROBE_DEFER till bridge attached

As dw-mipi-dsi supported all possible ways to find the DSI
devices. It can take multiple iterations for ltdc to find
all components attached to the DSI bridge.

The current ltdc driver failed to find the endpoint as
it returned -EINVAL for the first iteration itself. This leads
to following error:

[    3.099289] [drm:ltdc_load] *ERROR* init encoder endpoint 0

So, check the return value and cleanup the encoder only if it's
not -EPROBE_DEFER. This make all components in the attached DSI
bridge found properly.
Signed-off-by: default avatarJagan Teki <jagan@amarulasolutions.com>
Tested-by: default avatarYannick Fertre <yannick.fertre@foss.st.com>
Acked-by: default avatarPhilippe Cornu <philippe.cornu@foss.st.com>
Signed-off-by: default avatarPhilippe Cornu <philippe.cornu@foss.st.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210704135914.268308-1-jagan@amarulasolutions.com
parent 57f6190a
...@@ -1121,8 +1121,9 @@ static int ltdc_encoder_init(struct drm_device *ddev, struct drm_bridge *bridge) ...@@ -1121,8 +1121,9 @@ static int ltdc_encoder_init(struct drm_device *ddev, struct drm_bridge *bridge)
ret = drm_bridge_attach(encoder, bridge, NULL, 0); ret = drm_bridge_attach(encoder, bridge, NULL, 0);
if (ret) { if (ret) {
drm_encoder_cleanup(encoder); if (ret != -EPROBE_DEFER)
return -EINVAL; drm_encoder_cleanup(encoder);
return ret;
} }
DRM_DEBUG_DRIVER("Bridge encoder:%d created\n", encoder->base.id); DRM_DEBUG_DRIVER("Bridge encoder:%d created\n", encoder->base.id);
...@@ -1265,7 +1266,8 @@ int ltdc_load(struct drm_device *ddev) ...@@ -1265,7 +1266,8 @@ int ltdc_load(struct drm_device *ddev)
if (bridge) { if (bridge) {
ret = ltdc_encoder_init(ddev, bridge); ret = ltdc_encoder_init(ddev, bridge);
if (ret) { if (ret) {
DRM_ERROR("init encoder endpoint %d\n", i); if (ret != -EPROBE_DEFER)
DRM_ERROR("init encoder endpoint %d\n", i);
goto err; goto err;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment