[PATCH 14/19] ASoC: soc-card: add snd_soc_card_late_probe()
Kuninori Morimoto
kuninori.morimoto.gx at renesas.com
Tue May 26 03:18:41 CEST 2020
From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
Card related function should be implemented at soc-card now.
This patch adds it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
---
include/sound/soc-card.h | 1 +
sound/soc/soc-card.c | 20 ++++++++++++++++++++
sound/soc/soc-core.c | 12 +++---------
3 files changed, 24 insertions(+), 9 deletions(-)
diff --git a/include/sound/soc-card.h b/include/sound/soc-card.h
index 38bb25428446..58b25963151a 100644
--- a/include/sound/soc-card.h
+++ b/include/sound/soc-card.h
@@ -25,6 +25,7 @@ int snd_soc_card_resume_pre(struct snd_soc_card *card);
int snd_soc_card_resume_post(struct snd_soc_card *card);
int snd_soc_card_probe(struct snd_soc_card *card);
+int snd_soc_card_late_probe(struct snd_soc_card *card);
/* device driver data */
static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card,
diff --git a/sound/soc/soc-card.c b/sound/soc/soc-card.c
index 49516fe7c54c..63bfcb0d1579 100644
--- a/sound/soc/soc-card.c
+++ b/sound/soc/soc-card.c
@@ -139,3 +139,23 @@ int snd_soc_card_probe(struct snd_soc_card *card)
return 0;
}
+
+int snd_soc_card_late_probe(struct snd_soc_card *card)
+{
+ if (card->late_probe) {
+ int ret = card->late_probe(card);
+
+ if (ret < 0)
+ return soc_card_ret(card, ret);
+ }
+
+ /*
+ * set probed here
+ * see
+ * snd_soc_bind_card()
+ * snd_soc_card_probe()
+ */
+ card->probed = 1;
+
+ return 0;
+}
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 13a7d5158534..42e8c11a0b26 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1910,15 +1910,9 @@ static int snd_soc_bind_card(struct snd_soc_card *card)
}
}
- if (card->late_probe) {
- ret = card->late_probe(card);
- if (ret < 0) {
- dev_err(card->dev, "ASoC: %s late_probe() failed: %d\n",
- card->name, ret);
- goto probe_end;
- }
- }
- card->probed = 1;
+ ret = snd_soc_card_late_probe(card);
+ if (ret < 0)
+ goto probe_end;
snd_soc_dapm_new_widgets(card);
--
2.17.1
More information about the Alsa-devel
mailing list