Unverified Commit 5ac7c1b2 authored by Bard Liao's avatar Bard Liao Committed by Mark Brown
Browse files

ASoC: intel: cml_rt1011_rt5682: use for_each_card_prelinks

parent 8a473c39
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -533,6 +533,7 @@ static struct snd_soc_card snd_soc_card_cml = {

static int snd_cml_rt1011_probe(struct platform_device *pdev)
{
	struct snd_soc_dai_link *dai_link;
	struct card_private *ctx;
	struct snd_soc_acpi_mach *mach;
	const char *platform_name;
@@ -554,12 +555,11 @@ static int snd_cml_rt1011_probe(struct platform_device *pdev)
	/* when 4 speaker is available, update codec config */
	if (sof_rt1011_quirk & (SOF_RT1011_SPEAKER_TL |
				SOF_RT1011_SPEAKER_TR)) {
		for (i = 0; i < ARRAY_SIZE(cml_rt1011_rt5682_dailink); i++) {
			if (!strcmp(cml_rt1011_rt5682_dailink[i].codecs->dai_name,
		for_each_card_prelinks(&snd_soc_card_cml, i, dai_link) {
			if (!strcmp(dai_link->codecs->dai_name,
				    CML_RT1011_CODEC_DAI)) {
				cml_rt1011_rt5682_dailink[i].codecs = ssp1_codec_4spk;
				cml_rt1011_rt5682_dailink[i].num_codecs =
						ARRAY_SIZE(ssp1_codec_4spk);
				dai_link->codecs = ssp1_codec_4spk;
				dai_link->num_codecs = ARRAY_SIZE(ssp1_codec_4spk);
			}
		}
	}