aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-09-29 14:34:41 +1000
committerAlex Deucher <alexander.deucher@amd.com>2017-09-29 13:02:48 -0400
commitdb6c3bdcfe2d810338f90a13d415d43dd98d342b (patch)
treeea7d9e766d4aaff1986088a82e26e4cf0179e348 /drivers/gpu/drm/amd/display/dc/core/dc_surface.c
parentamdgpu/dc: remove pointless return from build_pipe_hw_param (diff)
downloadlinux-dev-db6c3bdcfe2d810338f90a13d415d43dd98d342b.tar.xz
linux-dev-db6c3bdcfe2d810338f90a13d415d43dd98d342b.zip
amdgpu: fixup construct to void paths on some more dc objects.
Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/core/dc_surface.c')
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc_surface.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_surface.c b/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
index 511ada94530e..f170ae95529c 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
@@ -34,12 +34,11 @@
/*******************************************************************************
* Private functions
******************************************************************************/
-static bool construct(struct dc_context *ctx, struct dc_plane_state *plane_state)
+static void construct(struct dc_context *ctx, struct dc_plane_state *plane_state)
{
plane_state->ctx = ctx;
memset(&plane_state->hdr_static_ctx,
0, sizeof(struct dc_hdr_static_metadata));
- return true;
}
static void destruct(struct dc_plane_state *plane_state)
@@ -72,20 +71,12 @@ struct dc_plane_state *dc_create_plane_state(struct dc *dc)
GFP_KERNEL);
if (NULL == plane_state)
- goto alloc_fail;
-
- if (false == construct(core_dc->ctx, plane_state))
- goto construct_fail;
+ return NULL;
+ construct(core_dc->ctx, plane_state);
atomic_inc(&plane_state->ref_count);
return plane_state;
-
-construct_fail:
- kfree(plane_state);
-
-alloc_fail:
- return NULL;
}
const struct dc_plane_status *dc_plane_get_status(