From 83c3eb7b0ebd40bbfd713010eb301b8b1fa5f78e Mon Sep 17 00:00:00 2001 From: Keyon Jie Date: Fri, 10 Aug 2018 19:30:30 +0800 Subject: [PATCH] ASoC: SOF: topology: continue parsing when num_hw_configs is not 1 Only give warning and continue parsing when num_hw_configs is not 1. this is needed for HDA dai parsing. Signed-off-by: Mengdong Lin Signed-off-by: Keyon Jie --- sound/soc/sof/topology.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index 32bef181dde9f7..e4b7cc0a96f937 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -1786,12 +1786,10 @@ static int sof_link_load(struct snd_soc_component *scomp, int index, if (!link->no_pcm) return 0; - /* only support 1 config atm */ - if (le32_to_cpu(cfg->num_hw_configs) != 1) { - dev_err(sdev->dev, "error: unexpected DAI config count %d\n", + /* usually we use 1 config, but for HDA it may be 0 ATM */ + if (le32_to_cpu(cfg->num_hw_configs) != 1) + dev_warn(sdev->dev, "warn: unexpected DAI config count %d!\n", le32_to_cpu(cfg->num_hw_configs)); - return -EINVAL; - } /* check we have some tokens - we need at least DAI type */ if (le32_to_cpu(private->size) == 0) {