Skip to contentSkip to conversation

ASoC: soc_bind_dai_link() change 2nd argument to DAI link pointer

RFC PATCH Superseded [email protected] 1 participant 1 message Aug 10, 2015

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

RFC PATCH 3/10 ASoC: soc_bind_dai_link() change 2nd argument to DAI link pointer

From: Mengdong Lin <[email protected]>

Just code refactoring, to reuse it if new DAI Links are added later based on topology in component probing phase.

sound/soc/soc-core.c +4 -4
index e9e8956..ddfdd1d 100644
@@ -961,9 +961,9 @@ static struct snd_soc_dai *snd_soc_find_dai(
 	return NULL;
 }
 
-static int soc_bind_dai_link(struct snd_soc_card *card, int num)
+static int soc_bind_dai_link(struct snd_soc_card *card,
+	struct snd_soc_dai_link *dai_link)
 {
-	struct snd_soc_dai_link *dai_link = &card->dai_link[num];
 	struct snd_soc_pcm_runtime *rtd;
 	struct snd_soc_dai_link_component *codecs = dai_link->codecs;
 	struct snd_soc_dai_link_component cpu_dai_component;
@@ -972,7 +972,7 @@ static int soc_bind_dai_link(struct snd_soc_card *card, int num)
 	const char *platform_name;
 	int i;
 
-	dev_dbg(card->dev, "ASoC: binding %s at idx %d\n", dai_link->name, num);
+	dev_dbg(card->dev, "ASoC: binding %s\n", dai_link->name);
 
 	if (snd_soc_get_pcm_runtime(card, dai_link->name)) {
 		dev_dbg(card->dev, "ASoC: dai link %s already bound\n",
@@ -1717,7 +1717,7 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
 
 	/* bind DAIs */
 	for (i = 0; i < card->num_links; i++) {
-		ret = soc_bind_dai_link(card, i);
+		ret = soc_bind_dai_link(card, &card->dai_link[i]);
 		if (ret != 0)
 			goto base_error;
 	}
Signature · 1 line
1.9.1