drm/ttm: tt destroy move null check to outer function.
authorDave Airlie <airlied@redhat.com>
Tue, 15 Sep 2020 01:04:08 +0000 (11:04 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 15 Sep 2020 23:34:33 +0000 (09:34 +1000)
This just makes things easier later.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200915024007.67163-4-airlied@gmail.com
drivers/gpu/drm/ttm/ttm_bo.c
drivers/gpu/drm/ttm/ttm_bo_util.c
drivers/gpu/drm/ttm/ttm_tt.c

index aea61017f03a17316944bd241276677b012a094b..bca0d42a970a9b0d893f72a25ebdab2a43a90f7a 100644 (file)
@@ -1613,6 +1613,8 @@ EXPORT_SYMBOL(ttm_bo_swapout_all);
 
 void ttm_bo_tt_destroy(struct ttm_buffer_object *bo)
 {
+       if (bo->ttm == NULL)
+               return;
        ttm_tt_destroy(bo->bdev, bo->ttm);
        bo->ttm = NULL;
 }
index 0d2f3bc5df92a4da98e20c1e50ba80ea47e5d02f..8389972a1ed6f87510075bd85384ff2c913e7224 100644 (file)
@@ -696,3 +696,4 @@ int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo)
 
        return 0;
 }
+
index ff3d953aa90ed4441b61d748c5a2b89ce514357a..381face3cedb79418da9f6da29d94596f5991ecd 100644 (file)
@@ -209,9 +209,6 @@ EXPORT_SYMBOL(ttm_tt_set_placement_caching);
 
 void ttm_tt_destroy(struct ttm_bo_device *bdev, struct ttm_tt *ttm)
 {
-       if (ttm == NULL)
-               return;
-
        ttm_tt_unbind(bdev, ttm);
 
        ttm_tt_unpopulate(bdev, ttm);