drm: Replace kernel.h with the necessary inclusions
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 10 Nov 2021 10:24:23 +0000 (12:24 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Thu, 9 Dec 2021 12:46:13 +0000 (13:46 +0100)
When kernel.h is used in the headers it adds a lot into dependency hell,
especially when there are circular dependencies are involved.

Replace kernel.h inclusion with the list of what is really being used.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20211110102423.54282-1-andriy.shevchenko@linux.intel.com
include/drm/drm_gem_ttm_helper.h
include/drm/drm_gem_vram_helper.h
include/drm/drm_mm.h

index c1aa02bd4c8935e3abbdb00b2956f717d03bb964..78040f6cc6f3919c0958695e1422373af28387ee 100644 (file)
@@ -3,7 +3,7 @@
 #ifndef DRM_GEM_TTM_HELPER_H
 #define DRM_GEM_TTM_HELPER_H
 
-#include <linux/kernel.h>
+#include <linux/container_of.h>
 
 #include <drm/drm_device.h>
 #include <drm/drm_gem.h>
index d3cf06c9af652600e1cf0a04db1b170b6d783c22..b4ce27a72773312b7cde1798ce18ebb1f07635cd 100644 (file)
@@ -11,8 +11,8 @@
 #include <drm/ttm/ttm_bo_api.h>
 #include <drm/ttm/ttm_bo_driver.h>
 
+#include <linux/container_of.h>
 #include <linux/dma-buf-map.h>
-#include <linux/kernel.h> /* for container_of() */
 
 struct drm_mode_create_dumb;
 struct drm_plane;
index 9b4292f229c67d59ab17cfa3ca8445f7b8db36e4..ac33ba1b18bc5597586b580f1cc6451feec5aa01 100644 (file)
  */
 #include <linux/bug.h>
 #include <linux/rbtree.h>
-#include <linux/kernel.h>
+#include <linux/limits.h>
 #include <linux/mm_types.h>
 #include <linux/list.h>
 #include <linux/spinlock.h>
 #ifdef CONFIG_DRM_DEBUG_MM
 #include <linux/stackdepot.h>
 #endif
+#include <linux/types.h>
+
 #include <drm/drm_print.h>
 
 #ifdef CONFIG_DRM_DEBUG_MM