summaryrefslogtreecommitdiff
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2019-01-22 17:36:11 +0000
committerMark Brown <broonie@kernel.org>2019-01-22 17:36:11 +0000
commit3f6a125230d8bfcbfe0c06ff0b8eaccbc727acd7 (patch)
treefb3b1cd3c0367426c7458154cfa60faeb58996c7 /sound/soc/soc-core.c
parentfe7ed4dec2e6289eab81dd18c0d613c0851d85a1 (diff)
ASoC: core: Fix multi-CODEC setups
Revert 10dff9b0d (ASoC: soc-core: use for_each_link_codecs() for dai_link codecs) for now as Sylwester Nawrocki reports that it causes oopses on at least Odroid boards. Reported-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 1c92b4aff57b..8a58fa86675a 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -870,7 +870,7 @@ static int soc_bind_dai_link(struct snd_soc_card *card,
struct snd_soc_dai_link *dai_link)
{
struct snd_soc_pcm_runtime *rtd;
- struct snd_soc_dai_link_component *codecs;
+ struct snd_soc_dai_link_component *codecs = dai_link->codecs;
struct snd_soc_dai_link_component cpu_dai_component;
struct snd_soc_component *component;
struct snd_soc_dai **codec_dais;
@@ -905,8 +905,9 @@ static int soc_bind_dai_link(struct snd_soc_card *card,
rtd->num_codecs = dai_link->num_codecs;
/* Find CODEC from registered CODECs */
+ /* we can use for_each_rtd_codec_dai() after this */
codec_dais = rtd->codec_dais;
- for_each_link_codecs(dai_link, i, codecs) {
+ for (i = 0; i < rtd->num_codecs; i++) {
codec_dais[i] = snd_soc_find_dai(&codecs[i]);
if (!codec_dais[i]) {
dev_info(card->dev, "ASoC: CODEC DAI %s not registered\n",