]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/gpu/drm/drm_modes.c
drm: Preserve the list head in drm_mode_copy
[karo-tx-linux.git] / drivers / gpu / drm / drm_modes.c
index 09785422e6542e6e395fe121a860c737e3b8fbbc..69153385c63f5fd52aaeb0a45209b9e6a657e0d5 100644 (file)
@@ -789,16 +789,17 @@ EXPORT_SYMBOL(drm_mode_set_crtcinfo);
  * LOCKING:
  * None.
  *
- * Copy an existing mode into another mode, preserving the object id
- * of the destination mode.
+ * Copy an existing mode into another mode, preserving the object id and
+ * list head of the destination mode.
  */
 void drm_mode_copy(struct drm_display_mode *dst, const struct drm_display_mode *src)
 {
        int id = dst->base.id;
+       struct list_head head = dst->head;
 
        *dst = *src;
        dst->base.id = id;
-       INIT_LIST_HEAD(&dst->head);
+       dst->head = head;
 }
 EXPORT_SYMBOL(drm_mode_copy);