From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>,
"Rojewski, Cezary" <cezary.rojewski@intel.com>
Cc: linux-sound@vger.kernel.org
Subject: [PATCH 2/2] ASoC: soc-core: handle card->list in snd_soc_unbind_card()
Date: Wed, 13 May 2026 01:48:48 +0000 [thread overview]
Message-ID: <87wlx85bb3.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87zf245bc3.wl-kuninori.morimoto.gx@renesas.com>
snd_soc_bind_card() is handling card->list inside, but
snd_soc_unbind_card() is handling it in outside.
Let's handle it inside.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
sound/soc/soc-core.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index ae8467d88978e..8b2269ba67c3a 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1990,12 +1990,18 @@ static void soc_cleanup_card_resources(struct snd_soc_card *card)
}
}
-static void snd_soc_unbind_card(struct snd_soc_card *card)
+static void snd_soc_unbind_card(struct snd_soc_card *card, bool add_to_list)
{
if (snd_soc_card_is_instantiated(card)) {
card->instantiated = false;
soc_cleanup_card_resources(card);
+
+ if (add_to_list)
+ list_add(&card->list, &unbind_card_list);
}
+
+ if (!add_to_list)
+ list_del(&card->list);
}
static int snd_soc_bind_card(struct snd_soc_card *card)
@@ -2439,8 +2445,7 @@ void snd_soc_unregister_card(struct snd_soc_card *card)
{
guard(mutex)(&client_mutex);
- snd_soc_unbind_card(card);
- list_del(&card->list);
+ snd_soc_unbind_card(card, false);
dev_dbg(card->dev, "ASoC: Unregistered card '%s'\n", card->name);
}
@@ -2667,12 +2672,8 @@ static void snd_soc_del_component_unlocked(struct snd_soc_component *component)
snd_soc_unregister_dais(component);
- if (card) {
- instantiated = card->instantiated;
- snd_soc_unbind_card(card);
- if (instantiated)
- list_add(&card->list, &unbind_card_list);
- }
+ if (card)
+ snd_soc_unbind_card(card, true);
list_del(&component->list);
}
--
2.43.0
next prev parent reply other threads:[~2026-05-13 1:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-13 1:48 [PATCH 0/2] ASoC: tidyup card rebind functions Kuninori Morimoto
2026-05-13 1:48 ` [PATCH 1/2] ASoC: soc-core: add soc_rebind_card() Kuninori Morimoto
2026-05-13 21:01 ` Rojewski, Cezary
2026-05-13 23:36 ` Kuninori Morimoto
2026-05-13 1:48 ` Kuninori Morimoto [this message]
2026-05-13 20:46 ` [PATCH 2/2] ASoC: soc-core: handle card->list in snd_soc_unbind_card() Rojewski, Cezary
2026-05-14 0:04 ` Kuninori Morimoto
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wlx85bb3.wl-kuninori.morimoto.gx@renesas.com \
--to=kuninori.morimoto.gx@renesas.com \
--cc=broonie@kernel.org \
--cc=cezary.rojewski@intel.com \
--cc=linux-sound@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox