[12/14] ASoC: soc-core: rename soc_link_init() to soc_init_pcm_runtime()
diff mbox series

Message ID 87a78o8o2m.wl-kuninori.morimoto.gx@renesas.com
State New
Headers show
Series
  • ASoC: soc-core cleanup step6
Related show

Commit Message

Kuninori Morimoto Nov. 22, 2019, 5:41 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

soc-core is using soc_link_init().
It sounds like dai_link function, but it is for pcm_runtime.

This patch renames soc_link_init() to soc_init_pcm_runtime(),
and checks missing return value.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/soc-core.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

Comments

Pierre-Louis Bossart Nov. 22, 2019, 4:41 p.m. UTC | #1
> +static int soc_init_pcm_runtime(struct snd_soc_card *card,
> +				struct snd_soc_pcm_runtime *rtd)
>   {
>   	struct snd_soc_dai_link *dai_link = rtd->dai_link;
>   	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
> @@ -1998,8 +1998,11 @@ static int snd_soc_bind_card(struct snd_soc_card *card)
>   		goto probe_end;
>   	}
>   
> -	for_each_card_rtds(card, rtd)
> -		soc_link_init(card, rtd);
> +	for_each_card_rtds(card, rtd) {
> +		ret = soc_init_pcm_runtime(card, rtd);
> +		if (ret < 0)
> +			goto probe_end;
> +	}

might be better to first introduce the error check (functional change), 
then rename?

>   
>   	snd_soc_dapm_link_dai_widgets(card);
>   	snd_soc_dapm_connect_dai_link_widgets(card);
>

Patch
diff mbox series

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index f624a2f..843bfe1 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1123,8 +1123,8 @@  static int soc_dai_pcm_new(struct snd_soc_dai **dais, int num_dais,
 	return 0;
 }
 
-static int soc_link_init(struct snd_soc_card *card,
-			 struct snd_soc_pcm_runtime *rtd)
+static int soc_init_pcm_runtime(struct snd_soc_card *card,
+				struct snd_soc_pcm_runtime *rtd)
 {
 	struct snd_soc_dai_link *dai_link = rtd->dai_link;
 	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
@@ -1998,8 +1998,11 @@  static int snd_soc_bind_card(struct snd_soc_card *card)
 		goto probe_end;
 	}
 
-	for_each_card_rtds(card, rtd)
-		soc_link_init(card, rtd);
+	for_each_card_rtds(card, rtd) {
+		ret = soc_init_pcm_runtime(card, rtd);
+		if (ret < 0)
+			goto probe_end;
+	}
 
 	snd_soc_dapm_link_dai_widgets(card);
 	snd_soc_dapm_connect_dai_link_widgets(card);