From: Laurent Pinchart Date: Tue, 29 Nov 2016 18:55:44 +0000 (+0200) Subject: drm: bridge: Detach all bridges in a chain at encoder cleanup time X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6e15174ecd7ace10f1f996d4bc28b583987fcbac;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git drm: bridge: Detach all bridges in a chain at encoder cleanup time Instead of detaching only the bridge directly connected to the encoder, detach all bridges in the chain. Signed-off-by: Laurent Pinchart Reviewed-by: Daniel Vetter Signed-off-by: Archit Taneja Link: http://patchwork.freedesktop.org/patch/msgid/1481709550-29226-6-git-send-email-laurent.pinchart+renesas@ideasonboard.com --- diff --git a/drivers/gpu/drm/drm_encoder.c b/drivers/gpu/drm/drm_encoder.c index 0944f08abf58..5dde3c6b1467 100644 --- a/drivers/gpu/drm/drm_encoder.c +++ b/drivers/gpu/drm/drm_encoder.c @@ -159,8 +159,16 @@ void drm_encoder_cleanup(struct drm_encoder *encoder) * the indices on the drm_encoder after us in the encoder_list. */ - if (encoder->bridge) - drm_bridge_detach(encoder->bridge); + if (encoder->bridge) { + struct drm_bridge *bridge = encoder->bridge; + struct drm_bridge *next; + + while (bridge) { + next = bridge->next; + drm_bridge_detach(bridge); + bridge = next; + } + } drm_mode_object_unregister(dev, &encoder->base); kfree(encoder->name);