summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2020-09-15 11:04:08 +1000
committerDave Airlie <airlied@redhat.com>2020-09-16 09:34:33 +1000
commit395a73f8ba6f00f0e188ac6daa43659520d75498 (patch)
tree7142c71980929f5ea729fe9293e28d3e88ba526d /drivers
parent2ff6e69c0449846197c52d7c591b983e23e3e3c9 (diff)
downloadlinux-395a73f8ba6f00f0e188ac6daa43659520d75498.tar.bz2
drm/ttm: tt destroy move null check to outer function.
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
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo.c2
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo_util.c1
-rw-r--r--drivers/gpu/drm/ttm/ttm_tt.c3
3 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index aea61017f03a..bca0d42a970a 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -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;
}
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index 0d2f3bc5df92..8389972a1ed6 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -696,3 +696,4 @@ int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo)
return 0;
}
+
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index ff3d953aa90e..381face3cedb 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -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);