drm/i915: Move the gtt mm takedown to cleanup
authorBen Widawsky <benjamin.widawsky@intel.com>
Mon, 25 Nov 2013 17:54:43 +0000 (09:54 -0800)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 26 Nov 2013 09:21:27 +0000 (10:21 +0100)
Our VM code already has a cleanup function, and this is a nice place to
put the drm_mm_takedown. This should have no functional impact, it just
leaves the unload function a bit cleaer, and is more logical IMO

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/i915_gem_gtt.c

index 25acbb5eca6e7d1233155ac647388aef3dd53b31..5aeb103eae44cda34bae61164e62b7ee1a743046 100644 (file)
@@ -1777,7 +1777,6 @@ int i915_driver_unload(struct drm_device *dev)
 
        list_del(&dev_priv->gtt.base.global_link);
        WARN_ON(!list_empty(&dev_priv->vm_list));
-       drm_mm_takedown(&dev_priv->gtt.base.mm);
 
        drm_vblank_cleanup(dev);
 
index c1d04a36688f21c3d47d9a55ff05d7d57f715a67..056f1f0e2772adca686620f77539af542f54a05b 100644 (file)
@@ -1411,6 +1411,8 @@ static void gen6_gmch_remove(struct i915_address_space *vm)
 {
 
        struct i915_gtt *gtt = container_of(vm, struct i915_gtt, base);
+
+       drm_mm_takedown(&vm->mm);
        iounmap(gtt->gsm);
        teardown_scratch_page(vm->dev);
 }