drm/i915: Fix module unloading with DRM_I915_UMS=n
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 15 Nov 2013 16:16:33 +0000 (17:16 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 25 Nov 2013 08:41:03 +0000 (09:41 +0100)
Oops, makes testing early boot failures in i915.ko a bit more pain, so
let's fix it.

v2: We already have a bit of static storage to track this (Chris).

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Tested-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_drv.c

index 583adcb..804a139 100644 (file)
@@ -1022,6 +1022,11 @@ static int __init i915_init(void)
 
 static void __exit i915_exit(void)
 {
+#ifndef CONFIG_DRM_I915_UMS
+       if (!(driver.driver_features & DRIVER_MODESET))
+               return; /* Never loaded a driver. */
+#endif
+
        drm_pci_exit(&driver, &i915_pci_driver);
 }