summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorMark Brown2019-06-06 23:44:24 +0200
committerMark Brown2019-06-06 23:44:24 +0200
commita8e992342ce4cd173d437d0aa4eecc9e30489f72 (patch)
treedbb45d586ed7370e32c006c506d6954d06779914 /sound/soc/soc-core.c
parentASoC: soc-core: remove legacy style dai_link (diff)
parentSoC: rt274: Fix internal jack assignment in set_jack callback (diff)
downloadkernel-qcow2-linux-a8e992342ce4cd173d437d0aa4eecc9e30489f72.tar.gz
kernel-qcow2-linux-a8e992342ce4cd173d437d0aa4eecc9e30489f72.tar.xz
kernel-qcow2-linux-a8e992342ce4cd173d437d0aa4eecc9e30489f72.zip
Merge branch 'asoc-5.2' into asoc-5.3
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index f8426c8120b2..94a36ee8eb22 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1983,6 +1983,16 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
int ret, i, order;
mutex_lock(&client_mutex);
+ for_each_card_prelinks(card, i, dai_link) {
+ ret = soc_init_dai_link(card, dai_link);
+ if (ret) {
+ soc_cleanup_card_resources(card);
+ dev_err(card->dev, "ASoC: failed to init link %s: %d\n",
+ dai_link->name, ret);
+ mutex_unlock(&client_mutex);
+ return ret;
+ }
+ }
mutex_lock_nested(&card->mutex, SND_SOC_CARD_CLASS_INIT);
card->dapm.bias_level = SND_SOC_BIAS_OFF;
@@ -2707,25 +2717,9 @@ static int snd_soc_bind_card(struct snd_soc_card *card)
*/
int snd_soc_register_card(struct snd_soc_card *card)
{
- int i, ret;
- struct snd_soc_dai_link *link;
-
if (!card->name || !card->dev)
return -EINVAL;
- mutex_lock(&client_mutex);
- for_each_card_prelinks(card, i, link) {
-
- ret = soc_init_dai_link(card, link);
- if (ret) {
- dev_err(card->dev, "ASoC: failed to init link %s\n",
- link->name);
- mutex_unlock(&client_mutex);
- return ret;
- }
- }
- mutex_unlock(&client_mutex);
-
dev_set_drvdata(card->dev, card);
snd_soc_initialize_card_lists(card);