alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [alsa-devel] [PATCH 0/3] ASoC: soc-core cleanup step5+alpha
@ 2019-11-13  1:15 Kuninori Morimoto
  2019-11-13  1:16 ` [alsa-devel] [PATCH 1/3] ASoC: soc-core: call snd_soc_dapm_shutdown() at soc_cleanup_card_resources() Kuninori Morimoto
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Kuninori Morimoto @ 2019-11-13  1:15 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA


Hi Mark

I got report from you that some patch couldn't apply against current code.
I'm checking posted patches and accepted patches, and it seems not yet
accepted was previous series's [9/9].

1) is same as [9/9], and I checked that it can apply to your for-5.5 branch.

Jon Hunter reported that my below patch created bug.
2) and 3) are fixup patch for it.

bfce78a559655c5c4512a898a7e5d3a796fbb473
("ASoC: soc-core: tidyup soc_init_dai_link()")

Kuninori Morimoto (3):
  1) ASoC: soc-core: call snd_soc_dapm_shutdown() at soc_cleanup_card_resources()
  2) ASoC: soc-core: move snd_soc_unbind_card() next to snd_soc_bind_card()
  3) ASoC: soc-core: care card_probed at soc_cleanup_card_resources()

 sound/soc/soc-core.c | 46 ++++++++++++++++++++++++++--------------------
 1 file changed, 26 insertions(+), 20 deletions(-)

-- 
2.7.4

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [alsa-devel] [PATCH 1/3] ASoC: soc-core: call snd_soc_dapm_shutdown() at soc_cleanup_card_resources()
  2019-11-13  1:15 [alsa-devel] [PATCH 0/3] ASoC: soc-core cleanup step5+alpha Kuninori Morimoto
@ 2019-11-13  1:16 ` Kuninori Morimoto
  2019-11-15 12:25   ` [alsa-devel] Applied "ASoC: soc-core: call snd_soc_dapm_shutdown() at soc_cleanup_card_resources()" to the asoc tree Mark Brown
  2019-11-13  1:16 ` [alsa-devel] [PATCH 2/3] ASoC: soc-core: move snd_soc_unbind_card() next to snd_soc_bind_card() Kuninori Morimoto
  2019-11-13  1:16 ` [alsa-devel] [PATCH 3/3] ASoC: soc-core: care card_probed at soc_cleanup_card_resources() Kuninori Morimoto
  2 siblings, 1 reply; 7+ messages in thread
From: Kuninori Morimoto @ 2019-11-13  1:16 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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

It is easy to read code if it is cleanly using paired function/naming,
like start <-> stop, register <-> unregister, etc, etc.
But, current ALSA SoC code is very random, unbalance, not paired, etc.
It is easy to create bug at the such code, and it will be difficult to
debug.

snd_soc_bind_card() is calling snd_soc_dapm_init() for both
card and component.
Let's call paired snd_soc_dapm_shutdown() at paired
soc_cleanup_card_resources().

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

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 92260a9..216000a 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1953,6 +1953,8 @@ static void soc_cleanup_card_resources(struct snd_soc_card *card)
 		card->snd_card = NULL;
 	}
 
+	snd_soc_dapm_shutdown(card);
+
 	/* remove and free each DAI */
 	soc_remove_link_dais(card);
 
@@ -2389,7 +2391,6 @@ static void snd_soc_unbind_card(struct snd_soc_card *card, bool unregister)
 {
 	if (card->instantiated) {
 		card->instantiated = false;
-		snd_soc_dapm_shutdown(card);
 		snd_soc_flush_all_delayed_work(card);
 
 		soc_cleanup_card_resources(card);
-- 
2.7.4

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [alsa-devel] [PATCH 2/3] ASoC: soc-core: move snd_soc_unbind_card() next to snd_soc_bind_card()
  2019-11-13  1:15 [alsa-devel] [PATCH 0/3] ASoC: soc-core cleanup step5+alpha Kuninori Morimoto
  2019-11-13  1:16 ` [alsa-devel] [PATCH 1/3] ASoC: soc-core: call snd_soc_dapm_shutdown() at soc_cleanup_card_resources() Kuninori Morimoto
@ 2019-11-13  1:16 ` Kuninori Morimoto
  2019-11-15 12:25   ` [alsa-devel] Applied "ASoC: soc-core: move snd_soc_unbind_card() next to snd_soc_bind_card()" to the asoc tree Mark Brown
  2019-11-13  1:16 ` [alsa-devel] [PATCH 3/3] ASoC: soc-core: care card_probed at soc_cleanup_card_resources() Kuninori Morimoto
  2 siblings, 1 reply; 7+ messages in thread
From: Kuninori Morimoto @ 2019-11-13  1:16 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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

To makes code readable, this patch moves snd_soc_unbind_card() next
to snd_soc_bind_card().

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

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 216000a..a149697 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1973,6 +1973,21 @@ static void soc_cleanup_card_resources(struct snd_soc_card *card)
 		card->remove(card);
 }
 
+static void snd_soc_unbind_card(struct snd_soc_card *card, bool unregister)
+{
+	if (card->instantiated) {
+		card->instantiated = false;
+		snd_soc_flush_all_delayed_work(card);
+
+		soc_cleanup_card_resources(card);
+		if (!unregister)
+			list_add(&card->list, &unbind_card_list);
+	} else {
+		if (unregister)
+			list_del(&card->list);
+	}
+}
+
 static int snd_soc_bind_card(struct snd_soc_card *card)
 {
 	struct snd_soc_pcm_runtime *rtd;
@@ -2387,21 +2402,6 @@ int snd_soc_register_card(struct snd_soc_card *card)
 }
 EXPORT_SYMBOL_GPL(snd_soc_register_card);
 
-static void snd_soc_unbind_card(struct snd_soc_card *card, bool unregister)
-{
-	if (card->instantiated) {
-		card->instantiated = false;
-		snd_soc_flush_all_delayed_work(card);
-
-		soc_cleanup_card_resources(card);
-		if (!unregister)
-			list_add(&card->list, &unbind_card_list);
-	} else {
-		if (unregister)
-			list_del(&card->list);
-	}
-}
-
 /**
  * snd_soc_unregister_card - Unregister a card with the ASoC core
  *
-- 
2.7.4

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [alsa-devel] [PATCH 3/3] ASoC: soc-core: care card_probed at soc_cleanup_card_resources()
  2019-11-13  1:15 [alsa-devel] [PATCH 0/3] ASoC: soc-core cleanup step5+alpha Kuninori Morimoto
  2019-11-13  1:16 ` [alsa-devel] [PATCH 1/3] ASoC: soc-core: call snd_soc_dapm_shutdown() at soc_cleanup_card_resources() Kuninori Morimoto
  2019-11-13  1:16 ` [alsa-devel] [PATCH 2/3] ASoC: soc-core: move snd_soc_unbind_card() next to snd_soc_bind_card() Kuninori Morimoto
@ 2019-11-13  1:16 ` Kuninori Morimoto
  2019-11-15 12:25   ` [alsa-devel] Applied "ASoC: soc-core: care card_probed at soc_cleanup_card_resources()" to the asoc tree Mark Brown
  2 siblings, 1 reply; 7+ messages in thread
From: Kuninori Morimoto @ 2019-11-13  1:16 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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

soc_cleanup_card_resources() will call card->remove(), but it should be
called if card->probe() or card->late_probe() are called.
snd_soc_bind_card() might be error before calling
card->probe() / card->late_probe().
In that time, card->remove() will be called.
This patch adds card_probed parameter to judge it.

Fixes: bfce78a559655 ("ASoC: soc-core: tidyup soc_init_dai_link()")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
---
 sound/soc/soc-core.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index a149697..977a7bf 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1940,7 +1940,8 @@ static void __soc_setup_card_name(char *name, int len,
 	}
 }
 
-static void soc_cleanup_card_resources(struct snd_soc_card *card)
+static void soc_cleanup_card_resources(struct snd_soc_card *card,
+				       int card_probed)
 {
 	struct snd_soc_dai_link *link, *_link;
 
@@ -1969,17 +1970,19 @@ static void soc_cleanup_card_resources(struct snd_soc_card *card)
 	soc_cleanup_card_debugfs(card);
 
 	/* remove the card */
-	if (card->remove)
+	if (card_probed && card->remove)
 		card->remove(card);
 }
 
 static void snd_soc_unbind_card(struct snd_soc_card *card, bool unregister)
 {
 	if (card->instantiated) {
+		int card_probed = 1;
+
 		card->instantiated = false;
 		snd_soc_flush_all_delayed_work(card);
 
-		soc_cleanup_card_resources(card);
+		soc_cleanup_card_resources(card, card_probed);
 		if (!unregister)
 			list_add(&card->list, &unbind_card_list);
 	} else {
@@ -1992,7 +1995,7 @@ static int snd_soc_bind_card(struct snd_soc_card *card)
 {
 	struct snd_soc_pcm_runtime *rtd;
 	struct snd_soc_dai_link *dai_link;
-	int ret, i;
+	int ret, i, card_probed = 0;
 
 	mutex_lock(&client_mutex);
 	mutex_lock_nested(&card->mutex, SND_SOC_CARD_CLASS_INIT);
@@ -2044,6 +2047,7 @@ static int snd_soc_bind_card(struct snd_soc_card *card)
 		ret = card->probe(card);
 		if (ret < 0)
 			goto probe_end;
+		card_probed = 1;
 	}
 
 	/* probe all components used by DAI links on this card */
@@ -2109,6 +2113,7 @@ static int snd_soc_bind_card(struct snd_soc_card *card)
 			goto probe_end;
 		}
 	}
+	card_probed = 1;
 
 	snd_soc_dapm_new_widgets(card);
 
@@ -2138,7 +2143,7 @@ static int snd_soc_bind_card(struct snd_soc_card *card)
 
 probe_end:
 	if (ret < 0)
-		soc_cleanup_card_resources(card);
+		soc_cleanup_card_resources(card, card_probed);
 
 	mutex_unlock(&card->mutex);
 	mutex_unlock(&client_mutex);
-- 
2.7.4

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [alsa-devel] Applied "ASoC: soc-core: call snd_soc_dapm_shutdown() at soc_cleanup_card_resources()" to the asoc tree
  2019-11-13  1:16 ` [alsa-devel] [PATCH 1/3] ASoC: soc-core: call snd_soc_dapm_shutdown() at soc_cleanup_card_resources() Kuninori Morimoto
@ 2019-11-15 12:25   ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2019-11-15 12:25 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA, Mark Brown

The patch

   ASoC: soc-core: call snd_soc_dapm_shutdown() at soc_cleanup_card_resources()

has been applied to the asoc tree at

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

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 2a6f0892bda954dc2688b002060093ee0fe38528 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Wed, 13 Nov 2019 10:16:29 +0900
Subject: [PATCH] ASoC: soc-core: call snd_soc_dapm_shutdown() at
 soc_cleanup_card_resources()

It is easy to read code if it is cleanly using paired function/naming,
like start <-> stop, register <-> unregister, etc, etc.
But, current ALSA SoC code is very random, unbalance, not paired, etc.
It is easy to create bug at the such code, and it will be difficult to
debug.

snd_soc_bind_card() is calling snd_soc_dapm_init() for both
card and component.
Let's call paired snd_soc_dapm_shutdown() at paired
soc_cleanup_card_resources().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r22c4lub.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/soc-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 92260a9569a2..216000ae3e20 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1953,6 +1953,8 @@ static void soc_cleanup_card_resources(struct snd_soc_card *card)
 		card->snd_card = NULL;
 	}
 
+	snd_soc_dapm_shutdown(card);
+
 	/* remove and free each DAI */
 	soc_remove_link_dais(card);
 
@@ -2389,7 +2391,6 @@ static void snd_soc_unbind_card(struct snd_soc_card *card, bool unregister)
 {
 	if (card->instantiated) {
 		card->instantiated = false;
-		snd_soc_dapm_shutdown(card);
 		snd_soc_flush_all_delayed_work(card);
 
 		soc_cleanup_card_resources(card);
-- 
2.20.1

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [alsa-devel] Applied "ASoC: soc-core: care card_probed at soc_cleanup_card_resources()" to the asoc tree
  2019-11-13  1:16 ` [alsa-devel] [PATCH 3/3] ASoC: soc-core: care card_probed at soc_cleanup_card_resources() Kuninori Morimoto
@ 2019-11-15 12:25   ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2019-11-15 12:25 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA, Mark Brown, Jon Hunter

The patch

   ASoC: soc-core: care card_probed at soc_cleanup_card_resources()

has been applied to the asoc tree at

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

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 ce21401c9d30e81824e864dc25824ebeb9690801 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Wed, 13 Nov 2019 10:16:48 +0900
Subject: [PATCH] ASoC: soc-core: care card_probed at
 soc_cleanup_card_resources()

soc_cleanup_card_resources() will call card->remove(), but it should be
called if card->probe() or card->late_probe() are called.
snd_soc_bind_card() might be error before calling
card->probe() / card->late_probe().
In that time, card->remove() will be called.
This patch adds card_probed parameter to judge it.

Fixes: bfce78a559655 ("ASoC: soc-core: tidyup soc_init_dai_link()")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/r/87o8xg4ltr.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/soc-core.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index a149697e705d..977a7bfad519 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1940,7 +1940,8 @@ static void __soc_setup_card_name(char *name, int len,
 	}
 }
 
-static void soc_cleanup_card_resources(struct snd_soc_card *card)
+static void soc_cleanup_card_resources(struct snd_soc_card *card,
+				       int card_probed)
 {
 	struct snd_soc_dai_link *link, *_link;
 
@@ -1969,17 +1970,19 @@ static void soc_cleanup_card_resources(struct snd_soc_card *card)
 	soc_cleanup_card_debugfs(card);
 
 	/* remove the card */
-	if (card->remove)
+	if (card_probed && card->remove)
 		card->remove(card);
 }
 
 static void snd_soc_unbind_card(struct snd_soc_card *card, bool unregister)
 {
 	if (card->instantiated) {
+		int card_probed = 1;
+
 		card->instantiated = false;
 		snd_soc_flush_all_delayed_work(card);
 
-		soc_cleanup_card_resources(card);
+		soc_cleanup_card_resources(card, card_probed);
 		if (!unregister)
 			list_add(&card->list, &unbind_card_list);
 	} else {
@@ -1992,7 +1995,7 @@ static int snd_soc_bind_card(struct snd_soc_card *card)
 {
 	struct snd_soc_pcm_runtime *rtd;
 	struct snd_soc_dai_link *dai_link;
-	int ret, i;
+	int ret, i, card_probed = 0;
 
 	mutex_lock(&client_mutex);
 	mutex_lock_nested(&card->mutex, SND_SOC_CARD_CLASS_INIT);
@@ -2044,6 +2047,7 @@ static int snd_soc_bind_card(struct snd_soc_card *card)
 		ret = card->probe(card);
 		if (ret < 0)
 			goto probe_end;
+		card_probed = 1;
 	}
 
 	/* probe all components used by DAI links on this card */
@@ -2109,6 +2113,7 @@ static int snd_soc_bind_card(struct snd_soc_card *card)
 			goto probe_end;
 		}
 	}
+	card_probed = 1;
 
 	snd_soc_dapm_new_widgets(card);
 
@@ -2138,7 +2143,7 @@ static int snd_soc_bind_card(struct snd_soc_card *card)
 
 probe_end:
 	if (ret < 0)
-		soc_cleanup_card_resources(card);
+		soc_cleanup_card_resources(card, card_probed);
 
 	mutex_unlock(&card->mutex);
 	mutex_unlock(&client_mutex);
-- 
2.20.1

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [alsa-devel] Applied "ASoC: soc-core: move snd_soc_unbind_card() next to snd_soc_bind_card()" to the asoc tree
  2019-11-13  1:16 ` [alsa-devel] [PATCH 2/3] ASoC: soc-core: move snd_soc_unbind_card() next to snd_soc_bind_card() Kuninori Morimoto
@ 2019-11-15 12:25   ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2019-11-15 12:25 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA, Mark Brown

The patch

   ASoC: soc-core: move snd_soc_unbind_card() next to snd_soc_bind_card()

has been applied to the asoc tree at

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

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 2cc1afcfc617b33b72e409360ba5dd7c3fc2492d Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Wed, 13 Nov 2019 10:16:34 +0900
Subject: [PATCH] ASoC: soc-core: move snd_soc_unbind_card() next to
 snd_soc_bind_card()

To makes code readable, this patch moves snd_soc_unbind_card() next
to snd_soc_bind_card().

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

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 216000ae3e20..a149697e705d 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1973,6 +1973,21 @@ static void soc_cleanup_card_resources(struct snd_soc_card *card)
 		card->remove(card);
 }
 
+static void snd_soc_unbind_card(struct snd_soc_card *card, bool unregister)
+{
+	if (card->instantiated) {
+		card->instantiated = false;
+		snd_soc_flush_all_delayed_work(card);
+
+		soc_cleanup_card_resources(card);
+		if (!unregister)
+			list_add(&card->list, &unbind_card_list);
+	} else {
+		if (unregister)
+			list_del(&card->list);
+	}
+}
+
 static int snd_soc_bind_card(struct snd_soc_card *card)
 {
 	struct snd_soc_pcm_runtime *rtd;
@@ -2387,21 +2402,6 @@ int snd_soc_register_card(struct snd_soc_card *card)
 }
 EXPORT_SYMBOL_GPL(snd_soc_register_card);
 
-static void snd_soc_unbind_card(struct snd_soc_card *card, bool unregister)
-{
-	if (card->instantiated) {
-		card->instantiated = false;
-		snd_soc_flush_all_delayed_work(card);
-
-		soc_cleanup_card_resources(card);
-		if (!unregister)
-			list_add(&card->list, &unbind_card_list);
-	} else {
-		if (unregister)
-			list_del(&card->list);
-	}
-}
-
 /**
  * snd_soc_unregister_card - Unregister a card with the ASoC core
  *
-- 
2.20.1

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-11-15 12:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-13  1:15 [alsa-devel] [PATCH 0/3] ASoC: soc-core cleanup step5+alpha Kuninori Morimoto
2019-11-13  1:16 ` [alsa-devel] [PATCH 1/3] ASoC: soc-core: call snd_soc_dapm_shutdown() at soc_cleanup_card_resources() Kuninori Morimoto
2019-11-15 12:25   ` [alsa-devel] Applied "ASoC: soc-core: call snd_soc_dapm_shutdown() at soc_cleanup_card_resources()" to the asoc tree Mark Brown
2019-11-13  1:16 ` [alsa-devel] [PATCH 2/3] ASoC: soc-core: move snd_soc_unbind_card() next to snd_soc_bind_card() Kuninori Morimoto
2019-11-15 12:25   ` [alsa-devel] Applied "ASoC: soc-core: move snd_soc_unbind_card() next to snd_soc_bind_card()" to the asoc tree Mark Brown
2019-11-13  1:16 ` [alsa-devel] [PATCH 3/3] ASoC: soc-core: care card_probed at soc_cleanup_card_resources() Kuninori Morimoto
2019-11-15 12:25   ` [alsa-devel] Applied "ASoC: soc-core: care card_probed at soc_cleanup_card_resources()" to the asoc tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).