Applied "ASoC: soc-core: self contained soc_bind_aux_dev()" to the asoc tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch

   ASoC: soc-core: self contained soc_bind_aux_dev()

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.4

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From bee886f1ea9d9e58bef8204c543a409c399f8744 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
Date: Wed, 4 Sep 2019 09:15:28 +0900
Subject: [PATCH] ASoC: soc-core: self contained soc_bind_aux_dev()

Current soc_bind_aux_dev() implementation is very half,
thus it is very unreadable.

	for_each_card_pre_auxs(xxx) {
=>		ret = soc_bind_aux_dev(xxx);
		...
	}

This patch does all for_each_xxx() under soc_bind_aux_dev(),
and makes it to self contained.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
Link: https://lore.kernel.org/r/87tv9sor1b.wl-kuninori.morimoto.gx@xxxxxxxxxxx
Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
---
 sound/soc/soc-core.c | 31 +++++++++++++++----------------
 1 file changed, 15 insertions(+), 16 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 20381f69a34b..d7761df03e19 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1559,20 +1559,22 @@ static int soc_link_init(struct snd_soc_card *card,
 	return ret;
 }
 
-static int soc_bind_aux_dev(struct snd_soc_card *card,
-			    struct snd_soc_aux_dev *aux_dev)
+static int soc_bind_aux_dev(struct snd_soc_card *card)
 {
 	struct snd_soc_component *component;
+	struct snd_soc_aux_dev *aux;
+	int i;
 
-	/* codecs, usually analog devices */
-	component = soc_find_component(&aux_dev->dlc);
-	if (!component)
-		return -EPROBE_DEFER;
-
-	component->init = aux_dev->init;
-	/* see for_each_card_auxs */
-	list_add(&component->card_aux_list, &card->aux_comp_list);
+	for_each_card_pre_auxs(card, i, aux) {
+		/* codecs, usually analog devices */
+		component = soc_find_component(&aux->dlc);
+		if (!component)
+			return -EPROBE_DEFER;
 
+		component->init = aux->init;
+		/* see for_each_card_auxs */
+		list_add(&component->card_aux_list, &card->aux_comp_list);
+	}
 	return 0;
 }
 
@@ -1937,7 +1939,6 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
 {
 	struct snd_soc_pcm_runtime *rtd;
 	struct snd_soc_dai_link *dai_link;
-	struct snd_soc_aux_dev *aux;
 	int ret, i;
 
 	mutex_lock(&client_mutex);
@@ -1965,11 +1966,9 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
 	}
 
 	/* bind aux_devs too */
-	for_each_card_pre_auxs(card, i, aux) {
-		ret = soc_bind_aux_dev(card, aux);
-		if (ret != 0)
-			goto probe_end;
-	}
+	ret = soc_bind_aux_dev(card);
+	if (ret < 0)
+		goto probe_end;
 
 	/* add predefined DAI links to the list */
 	for_each_card_prelinks(card, i, dai_link) {
-- 
2.20.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux