diff mbox

[3/6] drm/ttm: move initializing ttm->sg into ttm_tt_init_fields

Message ID 20180306144347.1702-3-christian.koenig@amd.com (mailing list archive)
State New, archived
Headers show

Commit Message

Christian König March 6, 2018, 2:43 p.m. UTC
Better to set this with all other fields as well.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/ttm/ttm_tt.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index 65976238d24b..7e672be987b5 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -77,9 +77,6 @@  int ttm_tt_create(struct ttm_buffer_object *bo, bool zero_alloc)
 	if (unlikely(bo->ttm == NULL))
 		return -ENOMEM;
 
-	if (bo->type == ttm_bo_type_sg)
-		bo->ttm->sg = bo->sg;
-
 	return 0;
 }
 
@@ -245,6 +242,7 @@  void ttm_tt_init_fields(struct ttm_tt *ttm, struct ttm_buffer_object *bo,
 	ttm->page_flags = page_flags;
 	ttm->state = tt_unpopulated;
 	ttm->swap_storage = NULL;
+	ttm->sg = bo->sg;
 }
 
 int ttm_tt_init(struct ttm_tt *ttm, struct ttm_buffer_object *bo,