aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ttm/ttm_bo.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2016-06-06 04:17:51 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-07-07 14:54:33 -0400
commit4279cb1423d96e53b6b98ae9f2b41003b013a31f (patch)
tree2d89f2e0e76f5516664828589dc0ab03baf29db8 /drivers/gpu/drm/ttm/ttm_bo.c
parent089f16c55baacd5e8ae3745625efa82899b4b217 (diff)
drm/ttm: remove NULL checks when calling ttm_tt_destroy
The function is a no-op with a NULL pointer. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_bo.c')
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 4216b3162a8d..43a29555032e 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -147,8 +147,7 @@ static void ttm_bo_release_list(struct kref *list_kref)
147 BUG_ON(!list_empty(&bo->lru)); 147 BUG_ON(!list_empty(&bo->lru));
148 BUG_ON(!list_empty(&bo->ddestroy)); 148 BUG_ON(!list_empty(&bo->ddestroy));
149 149
150 if (bo->ttm) 150 ttm_tt_destroy(bo->ttm);
151 ttm_tt_destroy(bo->ttm);
152 atomic_dec(&bo->glob->bo_count); 151 atomic_dec(&bo->glob->bo_count);
153 if (bo->resv == &bo->ttm_resv) 152 if (bo->resv == &bo->ttm_resv)
154 reservation_object_fini(&bo->ttm_resv); 153 reservation_object_fini(&bo->ttm_resv);
@@ -396,7 +395,7 @@ moved:
396 395
397out_err: 396out_err:
398 new_man = &bdev->man[bo->mem.mem_type]; 397 new_man = &bdev->man[bo->mem.mem_type];
399 if ((new_man->flags & TTM_MEMTYPE_FLAG_FIXED) && bo->ttm) { 398 if (new_man->flags & TTM_MEMTYPE_FLAG_FIXED) {
400 ttm_tt_destroy(bo->ttm); 399 ttm_tt_destroy(bo->ttm);
401 bo->ttm = NULL; 400 bo->ttm = NULL;
402 } 401 }
@@ -417,10 +416,8 @@ static void ttm_bo_cleanup_memtype_use(struct ttm_buffer_object *bo)
417 if (bo->bdev->driver->move_notify) 416 if (bo->bdev->driver->move_notify)
418 bo->bdev->driver->move_notify(bo, NULL); 417 bo->bdev->driver->move_notify(bo, NULL);
419 418
420 if (bo->ttm) { 419 ttm_tt_destroy(bo->ttm);
421 ttm_tt_destroy(bo->ttm); 420 bo->ttm = NULL;
422 bo->ttm = NULL;
423 }
424 ttm_bo_mem_put(bo, &bo->mem); 421 ttm_bo_mem_put(bo, &bo->mem);
425 422
426 ww_mutex_unlock (&bo->resv->lock); 423 ww_mutex_unlock (&bo->resv->lock);