[Intel-gfx] [PATCH v2 1/2] drm/i915: Check num_pipes before initializing audio component

Wang, Elaine elaine.wang at intel.com
Thu Dec 22 07:03:24 UTC 2016


Hi Chris/Lahtine/Jani,

Could you help to review this patch?

Thanks,
Elaine
-----Original Message-----
From: Wang, Elaine 
Sent: Monday, December 19, 2016 6:19 PM
To: intel-gfx at lists.freedesktop.org; Wang, Elaine <elaine.wang at intel.com>
Cc: Chris Wilson <chris at chris-wilson.co.uk>; Joonas Lahtinen <joonas.lahtinen at linux.intel.com>; Jani Nikula <jani.nikula at linux.intel.com>
Subject: [PATCH v2 1/2] drm/i915: Check num_pipes before initializing audio component

From: Elaine Wang <elaine.wang at intel.com>

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 at chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
Cc: Jani Nikula <jani.nikula at linux.intel.com>
Signed-off-by: Elaine Wang <elaine.wang at intel.com>
---
 drivers/gpu/drm/i915/intel_audio.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
index 3bbc96c..16c2027 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);
--
1.9.1



More information about the Intel-gfx mailing list