[Sound-open-firmware] [PATCH 2/3] DAI: Check DAI type in dai_get() in CNL platform

Seppo Ingalsuo seppo.ingalsuo at linux.intel.com
Wed May 9 08:33:35 CEST 2018


Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo at linux.intel.com>
---
 src/platform/cannonlake/dai.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/platform/cannonlake/dai.c b/src/platform/cannonlake/dai.c
index 6b2db36..5a79614 100644
--- a/src/platform/cannonlake/dai.c
+++ b/src/platform/cannonlake/dai.c
@@ -99,9 +99,12 @@ struct dai *dai_get(uint32_t type, uint32_t index)
 {
 	int i;
 
-	for (i = 0; i < ARRAY_SIZE(ssp); i++) {
-		if (ssp[i].type == type && ssp[i].index == index)
-			return &ssp[i];
+	if (type == SOF_DAI_INTEL_SSP) {
+		for (i = 0; i < ARRAY_SIZE(ssp); i++) {
+			if (ssp[i].type == type && ssp[i].index == index)
+				return &ssp[i];
+		}
+	}
 	}
 
 	return NULL;
-- 
2.14.1



More information about the Sound-open-firmware mailing list