From: Gustavo Padovan Date: Fri, 12 May 2017 16:41:00 +0000 (-0300) Subject: drm/vc4: use drm_for_each_connector_iter() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4894bf711d19a1bdcc954e0ed4971d6c0b399b90;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm/vc4: use drm_for_each_connector_iter() Drop legacy drm_for_each_connector() in favor of the race-free drm_for_each_connector_iter(). v2: add missing drm_connector_list_iter_end(Daniel Vetter) Cc: Eric Anholt Signed-off-by: Gustavo Padovan Reviewed-by: Daniel Vetter Acked-by: Eric Anholt Link: http://patchwork.freedesktop.org/patch/msgid/20170512164100.7649-1-gustavo@padovan.org --- diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c index 0bfc4d88e4c2..403bbd5f99a9 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -345,12 +345,16 @@ static u32 vc4_get_fifo_full_level(u32 format) static struct drm_encoder *vc4_get_crtc_encoder(struct drm_crtc *crtc) { struct drm_connector *connector; + struct drm_connector_list_iter conn_iter; - drm_for_each_connector(connector, crtc->dev) { + drm_connector_list_iter_begin(crtc->dev, &conn_iter); + drm_for_each_connector_iter(connector, &conn_iter) { if (connector->state->crtc == crtc) { + drm_connector_list_iter_end(&conn_iter); return connector->encoder; } } + drm_connector_list_iter_end(&conn_iter); return NULL; }