OSDN Git Service

fixup i915 workqueue handling when modeset=1
authorHong Liu <hong.liu@intel.com>
Fri, 9 May 2008 02:08:36 +0000 (10:08 +0800)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Fri, 9 May 2008 21:29:10 +0000 (14:29 -0700)
Fixup workqueue creation error handling and make sure we destroy the queue on
unload.

shared-core/i915_init.c

index 8824b95..b9e7e17 100644 (file)
@@ -256,7 +256,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
                DRM_DEBUG("Enabled hardware status page\n");
 
                dev_priv->wq = create_singlethread_workqueue("i915");
-               if (dev_priv == 0) {
+               if (dev_priv->wq == 0) {
                  DRM_DEBUG("Error\n");
                }
 
@@ -291,6 +291,7 @@ int i915_driver_unload(struct drm_device *dev)
        if (drm_core_check_feature(dev, DRIVER_MODESET)) {
                drm_irq_uninstall(dev);
                intel_modeset_cleanup(dev);
+               destroy_workqueue(dev_priv->wq);
        }
 
 #if 0