From: Ander Conselvan de Oliveira Date: Tue, 21 Apr 2015 14:13:05 +0000 (+0300) Subject: drm/i915: Remove saved_mode from __intel_set_mode() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e13be6651743b6cebdd29d4049dcd52b3ece4274;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm/i915: Remove saved_mode from __intel_set_mode() There's no way that function can fail after it sets crtc->mode anymore, so there's no need to save the old mode for the failure case. Signed-off-by: Ander Conselvan de Oliveira Reviewed-by: Maarten Lankhorst Signed-off-by: Daniel Vetter --- diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 62163d4e9b5f..e47dddf4aacb 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -12239,7 +12239,6 @@ static int __intel_set_mode(struct drm_crtc *modeset_crtc, { struct drm_device *dev = modeset_crtc->dev; struct drm_i915_private *dev_priv = dev->dev_private; - struct drm_display_mode *saved_mode; struct drm_atomic_state *state = pipe_config->base.state; struct intel_crtc_state *crtc_state_copy = NULL; struct intel_crtc *intel_crtc; @@ -12248,18 +12247,12 @@ static int __intel_set_mode(struct drm_crtc *modeset_crtc, int ret = 0; int i; - saved_mode = kmalloc(sizeof(*saved_mode), GFP_KERNEL); - if (!saved_mode) - return -ENOMEM; - crtc_state_copy = kmalloc(sizeof(*crtc_state_copy), GFP_KERNEL); if (!crtc_state_copy) { ret = -ENOMEM; goto done; } - *saved_mode = modeset_crtc->mode; - /* * See if the config requires any additional preparation, e.g. * to adjust global state with pipes off. We need to do this @@ -12346,9 +12339,6 @@ static int __intel_set_mode(struct drm_crtc *modeset_crtc, /* FIXME: add subpixel order */ done: - if (ret && modeset_crtc->state->enable) - modeset_crtc->mode = *saved_mode; - if (ret == 0 && pipe_config) { struct intel_crtc *intel_crtc = to_intel_crtc(modeset_crtc); @@ -12362,7 +12352,6 @@ done: kfree(crtc_state_copy); } - kfree(saved_mode); return ret; }