summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2007-12-06 16:03:28 +1000
committerDave Airlie <airlied@redhat.com>2007-12-06 16:03:28 +1000
commitf1a99ddc14ebca303f20b6c23bd289fc887243ae (patch)
treee5cd571d41f398d58287349fa9bfa92a75dcca3c
parenta64a4373e85a321a359e147b2c7220d501dff06a (diff)
take down stuff after asking driver to unload
-rw-r--r--linux-core/drm_drv.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c
index 869748f8..343d5f32 100644
--- a/linux-core/drm_drv.c
+++ b/linux-core/drm_drv.c
@@ -394,15 +394,6 @@ static void drm_cleanup(struct drm_device * dev)
drm_lastclose(dev);
drm_fence_manager_takedown(dev);
- drm_ht_remove(&dev->map_hash);
- drm_mm_takedown(&dev->offset_manager);
- drm_ht_remove(&dev->object_hash);
-
- if (!drm_fb_loaded)
- pci_disable_device(dev->pdev);
-
- drm_ctxbitmap_cleanup(dev);
-
if (drm_core_has_MTRR(dev) && drm_core_has_AGP(dev) && dev->agp
&& dev->agp->agp_mtrr >= 0) {
int retval;
@@ -419,6 +410,14 @@ static void drm_cleanup(struct drm_device * dev)
if (dev->driver->unload)
dev->driver->unload(dev);
+ if (!drm_fb_loaded)
+ pci_disable_device(dev->pdev);
+
+ drm_ctxbitmap_cleanup(dev);
+ drm_ht_remove(&dev->map_hash);
+ drm_mm_takedown(&dev->offset_manager);
+ drm_ht_remove(&dev->object_hash);
+
drm_put_head(&dev->primary);
if (drm_put_dev(dev))
DRM_ERROR("Cannot unload module\n");