summaryrefslogtreecommitdiff
path: root/sound/soc/intel/boards
diff options
context:
space:
mode:
authorBard Liao <yung-chuan.liao@linux.intel.com>2020-06-25 22:13:03 +0300
committerMark Brown <broonie@kernel.org>2020-06-26 15:35:21 +0300
commit5ac7c1b293107f43afb515665204587c423227f5 (patch)
tree7bd0e94482027ea64e51ed5f6dd1ffd6409e2794 /sound/soc/intel/boards
parent8a473c39ae54c27e694a131c34a739d0f8aa5300 (diff)
downloadlinux-5ac7c1b293107f43afb515665204587c423227f5.tar.xz
ASoC: intel: cml_rt1011_rt5682: use for_each_card_prelinks
for_each_card_prelinks() is a common API to walk through each prelink in the card. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20200625191308.3322-13-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel/boards')
-rw-r--r--sound/soc/intel/boards/cml_rt1011_rt5682.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sound/soc/intel/boards/cml_rt1011_rt5682.c b/sound/soc/intel/boards/cml_rt1011_rt5682.c
index d29b4a8ff70d..3f8b7d9820cd 100644
--- a/sound/soc/intel/boards/cml_rt1011_rt5682.c
+++ b/sound/soc/intel/boards/cml_rt1011_rt5682.c
@@ -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);
}
}
}