diff options
author | Leo (Sunpeng) Li <sunpeng.li@amd.com> | 2018-02-20 16:03:48 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-03-14 15:08:41 -0500 |
commit | d5400aab15761cd836e3d5d0ad34c330784bbe1a (patch) | |
tree | fb76874ea1abd3fa42459d2ab924e6a9ca484511 /drivers/gpu | |
parent | 8c45c5db842f9fdfd292b18dcad1b245dd7e1948 (diff) | |
download | linux-d5400aab15761cd836e3d5d0ad34c330784bbe1a.tar.bz2 |
drm/amd/display: Use correct error codes
Should return -ENOMEM when allocation fails.
Also, just return the error code instead of using a variable.
Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 914cd3f8500a..a215e2bbf2fb 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -4761,10 +4761,8 @@ static int dm_update_planes_state(struct dc *dc, WARN_ON(dm_new_plane_state->dc_state); dc_new_plane_state = dc_create_plane_state(dc); - if (!dc_new_plane_state) { - ret = -EINVAL; - return ret; - } + if (!dc_new_plane_state) + return -ENOMEM; DRM_DEBUG_DRIVER("Enabling DRM plane: %d on DRM crtc %d\n", plane->base.id, new_plane_crtc->base.id); @@ -4793,8 +4791,7 @@ static int dm_update_planes_state(struct dc *dc, dm_state->context)) { dc_plane_state_release(dc_new_plane_state); - ret = -EINVAL; - return ret; + return -EINVAL; } dm_new_plane_state->dc_state = dc_new_plane_state; |