]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/ttm: move initializing ttm->sg into ttm_tt_init_fields
authorChristian König <christian.koenig@amd.com>
Wed, 28 Feb 2018 08:48:22 +0000 (09:48 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 14 Mar 2018 19:38:28 +0000 (14:38 -0500)
Better to set this with all other fields as well.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Roger He <Hongbo.He@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/ttm/ttm_tt.c

index 65976238d24b209b16df56fe5f2c165c858afea7..7e672be987b5c15194cda65e7897bac7066c6515 100644 (file)
@@ -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,