[Intel-gfx] [PATCH] drm/i915: Fix module unloading with DRM_I915_UMS=n
Daniel Vetter
daniel.vetter at ffwll.ch
Fri Nov 15 11:28:39 CET 2013
Oops, makes testing early boot failures in i915.ko a bit more pain, so
let's fix it.
Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
drivers/gpu/drm/i915/i915_drv.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index c2e00ed23195..d9e5c6fc52ea 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -982,6 +982,8 @@ static struct pci_driver i915_pci_driver = {
.driver.pm = &i915_pm_ops,
};
+bool i915_no_driver_loaded;
+
static int __init i915_init(void)
{
driver.num_ioctls = i915_max_ioctl;
@@ -1011,6 +1013,7 @@ static int __init i915_init(void)
driver.get_vblank_timestamp = NULL;
#ifndef CONFIG_DRM_I915_UMS
/* Silently fail loading to not upset userspace. */
+ i915_no_driver_loaded = true;
return 0;
#endif
}
@@ -1020,6 +1023,9 @@ static int __init i915_init(void)
static void __exit i915_exit(void)
{
+ if (i915_no_driver_loaded)
+ return;
+
drm_pci_exit(&driver, &i915_pci_driver);
}
--
1.8.3.1
More information about the Intel-gfx
mailing list