[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181018111829.27056-4-marcel@ziswiler.com>
Date: Thu, 18 Oct 2018 13:18:29 +0200
From: Marcel Ziswiler <marcel@...wiler.com>
To: alsa-devel@...a-project.org, linux-tegra@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Mark Brown <broonie@...nel.org>,
Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>,
Marcel Ziswiler <marcel.ziswiler@...adex.com>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Liam Girdwood <lgirdwood@...il.com>
Subject: [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement
From: Marcel Ziswiler <marcel.ziswiler@...adex.com>
This fixes the following error as seen post commit daecf46ee0e5
("ASoC: soc-core: use snd_soc_dai_link_component for platform") on
Apalis TK1 after initial probe deferral:
tegra-snd-sgtl5000 sound: ASoC: Both platform name/of_node are set for
sgtl5000
tegra-snd-sgtl5000 sound: ASoC: failed to init link sgtl5000
tegra-snd-sgtl5000 sound: snd_soc_register_card failed (-22)
tegra-snd-sgtl5000: probe of sound failed with error -22
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@...adex.com>
---
Changes in v1:
- Split from the Tegra series as suggested by Mark.
- Fix issue in soc-core rather than working around it in tegra_sgtl5000.
sound/soc/soc-core.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 6ddcf12bc030..b97624005976 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2733,7 +2733,7 @@ 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;
+ struct snd_soc_dai_link *link = NULL;
if (!card->name || !card->dev)
return -EINVAL;
@@ -2744,7 +2744,7 @@ int snd_soc_register_card(struct snd_soc_card *card)
if (ret) {
dev_err(card->dev, "ASoC: failed to init link %s\n",
link->name);
- return ret;
+ goto err;
}
}
@@ -2763,7 +2763,17 @@ int snd_soc_register_card(struct snd_soc_card *card)
mutex_init(&card->mutex);
mutex_init(&card->dapm_mutex);
- return snd_soc_bind_card(card);
+ ret = snd_soc_bind_card(card);
+ if (ret)
+ goto err;
+
+ return 0;
+
+err:
+ if (link && link->platform)
+ link->platform = NULL;
+
+ return ret;
}
EXPORT_SYMBOL_GPL(snd_soc_register_card);
--
2.14.4
Powered by blists - more mailing lists