@@ -3072,18 +3072,12 @@ static void dm_crtc_destroy_state(struct drm_crtc *crtc,
static void dm_crtc_reset_state(struct drm_crtc *crtc)
{
- struct dm_crtc_state *state;
+ struct dm_crtc_state *state = kzalloc(sizeof(*state), GFP_KERNEL);
if (crtc->state)
dm_crtc_destroy_state(crtc, crtc->state);
- state = kzalloc(sizeof(*state), GFP_KERNEL);
- if (WARN_ON(!state))
- return;
-
- crtc->state = &state->base;
- crtc->state->crtc = crtc;
-
+ __drm_atomic_helper_crtc_reset(crtc, &state->base);
}
static struct drm_crtc_state *
Convert amd to using __drm_atomic_helper_crtc_reset(), instead of writing its own version. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Harry Wentland <harry.wentland@amd.com> Cc: Leo Li <sunpeng.li@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: "Christian König" <christian.koenig@amd.com> Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com> --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)