out_err:
new_man = ttm_manager_type(bdev, bo->mem.mem_type);
- if (!new_man->use_tt) {
- ttm_tt_destroy(bdev, bo->ttm);
- bo->ttm = NULL;
- }
+ if (!new_man->use_tt)
+ ttm_bo_tt_destroy(bo);
return ret;
}
if (bo->bdev->driver->move_notify)
bo->bdev->driver->move_notify(bo, false, NULL);
- ttm_tt_destroy(bo->bdev, bo->ttm);
- bo->ttm = NULL;
+ ttm_bo_tt_destroy(bo);
ttm_resource_free(bo, &bo->mem);
}
while (ttm_bo_swapout(&ttm_bo_glob, &ctx) == 0);
}
EXPORT_SYMBOL(ttm_bo_swapout_all);
+
+void ttm_bo_tt_destroy(struct ttm_buffer_object *bo)
+{
+ ttm_tt_destroy(bo->bdev, bo->ttm);
+ bo->ttm = NULL;
+}
*old_mem = *new_mem;
new_mem->mm_node = NULL;
- if (!man->use_tt) {
- ttm_tt_destroy(bdev, ttm);
- bo->ttm = NULL;
- }
+ if (!man->use_tt)
+ ttm_bo_tt_destroy(bo);
out1:
ttm_resource_iounmap(bdev, old_mem, new_iomap);
if (ret)
return ret;
- if (!man->use_tt) {
- ttm_tt_destroy(bdev, bo->ttm);
- bo->ttm = NULL;
- }
+ if (!man->use_tt)
+ ttm_bo_tt_destroy(bo);
ttm_bo_free_old_node(bo);
} else {
/**
if (ret)
return ret;
- if (!to->use_tt) {
- ttm_tt_destroy(bdev, bo->ttm);
- bo->ttm = NULL;
- }
+ if (!to->use_tt)
+ ttm_bo_tt_destroy(bo);
ttm_bo_free_old_node(bo);
}