[alsa-devel] [PATCH] ASoC: core: remove pointless auxiliary from snd_soc_component

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Fri Mar 24 01:13:00 CET 2017


From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>

commit 1a653aa44725 ("ASoC: core: replace aux_comp_list to ...")
tried to replace aux_comp_list to component_dev_list,
but it failed because of binding timing. Thus, Sylwester fixuped it by
commit d2e3a1358c37 ("ASoC: Fix binding and probing of auxiliary...").

One of main purpose of commit 1a653aa44725 ("ASoC: core: replace...")
was remove replaceable list (= list_aux) from snd_soc_component by using
new "auxiliary" flags (but it failed).
Because of this background, current code has reborned card_aux_list
(= same as original list_aux), and almost pointless "auxiliary" flags.

Let's remove pointless "auxiliary" flags by this patch
This means, it is same as revert both
commit 1a653aa44725 ("ASoC: core: replace aux_comp_list to ...") and
commit d2e3a1358c37 ("ASoC: Fix binding and probing of auxiliary...").

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
Tested-by: Sylwester Nawrocki <s.nawrocki at samsung.com>
---
 include/sound/soc.h  |  1 -
 sound/soc/soc-core.c | 15 +++++----------
 2 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index dd78507..316fdce 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -815,7 +815,6 @@ struct snd_soc_component {
 
 	unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */
 	unsigned int registered_as_component:1;
-	unsigned int auxiliary:1; /* for auxiliary component of the card */
 	unsigned int suspended:1; /* is in suspend PM state */
 
 	struct list_head list;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index e7d876a..5933851 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1777,7 +1777,6 @@ static int soc_bind_aux_dev(struct snd_soc_card *card, int num)
 	}
 
 	component->init = aux_dev->init;
-	component->auxiliary = 1;
 	list_add(&component->card_aux_list, &card->aux_comp_list);
 
 	return 0;
@@ -1789,14 +1788,13 @@ static int soc_bind_aux_dev(struct snd_soc_card *card, int num)
 
 static int soc_probe_aux_devices(struct snd_soc_card *card)
 {
-	struct snd_soc_component *comp, *tmp;
+	struct snd_soc_component *comp;
 	int order;
 	int ret;
 
 	for (order = SND_SOC_COMP_ORDER_FIRST; order <= SND_SOC_COMP_ORDER_LAST;
 		order++) {
-		list_for_each_entry_safe(comp, tmp, &card->aux_comp_list,
-					 card_aux_list) {
+		list_for_each_entry(comp, &card->aux_comp_list, card_aux_list) {
 			if (comp->driver->probe_order == order) {
 				ret = soc_probe_component(card,	comp);
 				if (ret < 0) {
@@ -1805,7 +1803,6 @@ static int soc_probe_aux_devices(struct snd_soc_card *card)
 						comp->name, ret);
 					return ret;
 				}
-				list_del(&comp->card_aux_list);
 			}
 		}
 	}
@@ -1821,14 +1818,12 @@ static void soc_remove_aux_devices(struct snd_soc_card *card)
 	for (order = SND_SOC_COMP_ORDER_FIRST; order <= SND_SOC_COMP_ORDER_LAST;
 		order++) {
 		list_for_each_entry_safe(comp, _comp,
-			&card->component_dev_list, card_list) {
-
-			if (!comp->auxiliary)
-				continue;
+			&card->aux_comp_list, card_aux_list) {
 
 			if (comp->driver->remove_order == order) {
 				soc_remove_component(comp);
-				comp->auxiliary = 0;
+				/* remove it from the card's aux_comp_list */
+				list_del(&comp->card_aux_list);
 			}
 		}
 	}
-- 
1.9.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel at alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel


More information about the Alsa-devel mailing list