From: Elaine Wang Date: Mon, 19 Dec 2016 10:19:05 +0000 (+0800) Subject: drm/i915: Check num_pipes before initializing audio component X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=108109444ff64fb1a2976174ec23e9e2117b5709;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm/i915: Check num_pipes before initializing audio component when num_pipes is zero, it indicates there is no display and HDMI audio doesn't exist. v2: Move the check from caller to callee for consistency. Cc: Chris Wilson Cc: Joonas Lahtinen Cc: Jani Nikula Signed-off-by: Elaine Wang Reviewed-by: Jani Nikula Signed-off-by: Jani Nikula Link: http://patchwork.freedesktop.org/patch/msgid/1482142746-21663-1-git-send-email-elaine.wang@intel.com --- diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c index 3bbc96c1767f..16c202781db0 100644 --- a/drivers/gpu/drm/i915/intel_audio.c +++ b/drivers/gpu/drm/i915/intel_audio.c @@ -928,6 +928,9 @@ void i915_audio_component_init(struct drm_i915_private *dev_priv) { int ret; + if (INTEL_INFO(dev_priv)->num_pipes == 0) + return; + ret = component_add(dev_priv->drm.dev, &i915_audio_component_bind_ops); if (ret < 0) { DRM_ERROR("failed to add audio component (%d)\n", ret);