From: Egbert Eich Date: Tue, 18 Jul 2017 16:47:36 +0200 Subject: drm/ast: Simplify function ast_bo_unpin() Git-commit: 587b9b1a2a068c01fdf51003a7b6951761041d01 Patch-mainline: v4.14-rc1 References: FATE#326289 FATE#326079 FATE#326049 FATE#322398 FATE#326166 Just a code refactoring, no functional change. Signed-off-by: Egbert Eich Signed-off-by: Takashi Iwai Signed-off-by: Dave Airlie Acked-by: Petr Tesarik --- drivers/gpu/drm/ast/ast_ttm.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) --- a/drivers/gpu/drm/ast/ast_ttm.c +++ b/drivers/gpu/drm/ast/ast_ttm.c @@ -376,7 +376,7 @@ int ast_bo_pin(struct ast_bo *bo, u32 pl int ast_bo_unpin(struct ast_bo *bo) { - int i, ret; + int i; if (!bo->pin_count) { DRM_ERROR("unpin bad %p\n", bo); return 0; @@ -387,11 +387,7 @@ int ast_bo_unpin(struct ast_bo *bo) for (i = 0; i < bo->placement.num_placement ; i++) bo->placements[i].flags &= ~TTM_PL_FLAG_NO_EVICT; - ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false); - if (ret) - return ret; - - return 0; + return ttm_bo_validate(&bo->bo, &bo->placement, false, false); } int ast_bo_push_sysram(struct ast_bo *bo)