drm/etnaviv: add clock gating workaround for GC7000 r6202
[linux-2.6-microblaze.git] / drivers / gpu / drm / drm_dp_aux_dev.c
index e25181b..06b374c 100644 (file)
@@ -278,6 +278,12 @@ void drm_dp_aux_unregister_devnode(struct drm_dp_aux *aux)
        if (!aux_dev) /* attach must have failed */
                return;
 
+       /*
+        * As some AUX adapters may exist as platform devices which outlive their respective DRM
+        * devices, we clear drm_dev to ensure that we never accidentally reference a stale pointer
+        */
+       aux->drm_dev = NULL;
+
        mutex_lock(&aux_idr_mutex);
        idr_remove(&aux_idr, aux_dev->index);
        mutex_unlock(&aux_idr_mutex);