Unverified Commit af18b13f authored by Jerome Brunet's avatar Jerome Brunet Committed by Mark Brown
Browse files

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: default avatarJerome Brunet <jbrunet@baylibre.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8af6b229
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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;
	}

	/*