Commit 60c0a66e authored by Michał Winiarski's avatar Michał Winiarski Committed by Chris Wilson

drm/i915: Tidy error handling in i915_gem_init_hw

Let's reorder things so that we can do onion teardown rather than double
goto.

References: b96f6ebf ("drm/i915: Correctly handle error path in i915_gem_init_hw")
Signed-off-by: default avatarMichał Winiarski <michal.winiarski@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20180712124810.25241-1-michal.winiarski@intel.com
parent 5bfbeacf
...@@ -5313,13 +5313,17 @@ int i915_gem_init_hw(struct drm_i915_private *dev_priv) ...@@ -5313,13 +5313,17 @@ int i915_gem_init_hw(struct drm_i915_private *dev_priv)
ret = __i915_gem_restart_engines(dev_priv); ret = __i915_gem_restart_engines(dev_priv);
if (ret) if (ret)
goto cleanup_uc; goto cleanup_uc;
out:
intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL); intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
return ret;
return 0;
cleanup_uc: cleanup_uc:
intel_uc_fini_hw(dev_priv); intel_uc_fini_hw(dev_priv);
goto out; out:
intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
return ret;
} }
static int __intel_engines_record_defaults(struct drm_i915_private *i915) static int __intel_engines_record_defaults(struct drm_i915_private *i915)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment