diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c index 5d2831dfb8b9842acff6dd194337fee8bacee1f7..b03919ed60bade2f2051aeb4fc41389f64843608 100644 --- a/drivers/gpu/drm/imx/imx-ldb.c +++ b/drivers/gpu/drm/imx/imx-ldb.c @@ -297,15 +297,12 @@ static void imx_ldb_encoder_mode_set(struct drm_encoder *encoder, } if (!bus_format) { - struct drm_connector_state *conn_state; struct drm_connector *connector; - int i; - for_each_connector_in_state(encoder->crtc->state->state, - connector, conn_state, i) { + drm_for_each_connector(connector, encoder->dev) { struct drm_display_info *di = &connector->display_info; - if (conn_state->crtc == encoder->crtc && + if (connector->encoder == encoder && di->num_bus_formats) { bus_format = di->bus_formats[0]; break;