diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2016-11-29 13:55:44 -0500 |
---|---|---|
committer | Archit Taneja <architt@codeaurora.org> | 2016-12-18 06:02:49 -0500 |
commit | 6e15174ecd7ace10f1f996d4bc28b583987fcbac (patch) | |
tree | 849346e7e5905a16a58a3b9ce823d24a5f848f2e | |
parent | 4a878c03d56214a3dcf1a014e17c93bcdc587668 (diff) |
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 <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1481709550-29226-6-git-send-email-laurent.pinchart+renesas@ideasonboard.com
-rw-r--r-- | drivers/gpu/drm/drm_encoder.c | 12 |
1 files changed, 10 insertions, 2 deletions
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) | |||
159 | * the indices on the drm_encoder after us in the encoder_list. | 159 | * the indices on the drm_encoder after us in the encoder_list. |
160 | */ | 160 | */ |
161 | 161 | ||
162 | if (encoder->bridge) | 162 | if (encoder->bridge) { |
163 | drm_bridge_detach(encoder->bridge); | 163 | struct drm_bridge *bridge = encoder->bridge; |
164 | struct drm_bridge *next; | ||
165 | |||
166 | while (bridge) { | ||
167 | next = bridge->next; | ||
168 | drm_bridge_detach(bridge); | ||
169 | bridge = next; | ||
170 | } | ||
171 | } | ||
164 | 172 | ||
165 | drm_mode_object_unregister(dev, &encoder->base); | 173 | drm_mode_object_unregister(dev, &encoder->base); |
166 | kfree(encoder->name); | 174 | kfree(encoder->name); |