ASoC: soc-core: defer card registration if codec component is missing

Like cpus and platforms, defer sound card initialization if the codec
component is missing when initializing the dai_link

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Jerome Brunet 2019-06-27 14:13:49 +02:00 committed by Mark Brown
parent 8af6b2291e
commit af18b13fed
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 8 additions and 0 deletions

View File

@ -1071,12 +1071,20 @@ static int soc_init_dai_link(struct snd_soc_card *card,
link->name);
return -EINVAL;
}
/* Codec DAI name must be specified */
if (!codec->dai_name) {
dev_err(card->dev, "ASoC: codec_dai_name not set for %s\n",
link->name);
return -EINVAL;
}
/*
* Defer card registration if codec component is not added to
* component list.
*/
if (!soc_find_component(codec))
return -EPROBE_DEFER;
}
/*