drm/i915/dp: Correct the order of deletion for ghost eDP devices
authorTakashi Iwai <tiwai@suse.de>
Fri, 18 Mar 2011 09:06:49 +0000 (09:06 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 23 Mar 2011 09:16:59 +0000 (09:16 +0000)
The order of the calls does matter indeed.  Swapping the call order of
intel_dp_destroy() and intel_dp_encoder_destroy() fixes the problem.
This is because i2c_del_adapter unregisters the device which parent is
intel_connector, and connectors are removed in intel_dp_destroy().  Thus
intel_dp_encoder_destroy() must be called before intel_dp_destroy().

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=24822
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Keith Packard <keithp@keithp.com>
drivers/gpu/drm/i915/intel_dp.c

index d29e33f815d7ce8e4392e1c81704e2628c58fe51..0daefca5cbb83591ec83ffc391e3303b2f3ca50b 100644 (file)
@@ -1957,9 +1957,9 @@ intel_dp_init(struct drm_device *dev, int output_reg)
                                        DP_NO_AUX_HANDSHAKE_LINK_TRAINING;
                } else {
                        /* if this fails, presume the device is a ghost */
-                       DRM_ERROR("failed to retrieve link info\n");
-                       intel_dp_destroy(&intel_connector->base);
+                       DRM_INFO("failed to retrieve link info, disabling eDP\n");
                        intel_dp_encoder_destroy(&intel_dp->base.base);
+                       intel_dp_destroy(&intel_connector->base);
                        return;
                }
        }