Blob Blame History Raw
From 8c8a0f01c7c52f9037b6859ff5234ea5acf572d6 Mon Sep 17 00:00:00 2001
From: Charles Keepax <ckeepax@opensource.cirrus.com>
Date: Fri, 13 May 2022 10:05:31 +0100
Subject: [PATCH] ASoC: core: Pass legacy_dai_naming flag directly
Git-commit: 8c8a0f01c7c52f9037b6859ff5234ea5acf572d6
Patch-mainline: v5.19-rc1
References: jsc#PED-850

Passing the result of the helper function snd_soc_component_is_codec
to snd_soc_register_dai is less clear than just passing the DAI
naming flag directly. snd_soc_register_dai wants to know if it
should use the legacy DAI naming. The CODEC distinction is more
of a historical thing and not obviously directly related, and there
are already a couple of CPU side components that explicitly opt in
to non-legacy DAI naming.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220513090532.1450944-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Acked-by: Takashi Iwai <tiwai@suse.de>

---
 sound/soc/soc-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 32267a38130b..9574f86dd4de 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2497,7 +2497,7 @@ static int snd_soc_register_dais(struct snd_soc_component *component,
 
 	for (i = 0; i < count; i++) {
 		dai = snd_soc_register_dai(component, dai_drv + i, count == 1 &&
-					   !snd_soc_component_is_codec(component));
+					   !component->driver->non_legacy_dai_naming);
 		if (dai == NULL) {
 			ret = -ENOMEM;
 			goto err;
-- 
2.35.3