Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 10810944 authored by Elaine Wang's avatar Elaine Wang Committed by Jani Nikula
Browse files

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 <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: default avatarElaine Wang <elaine.wang@intel.com>
Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1482142746-21663-1-git-send-email-elaine.wang@intel.com
parent 093d680a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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);