From: Jerome Brunet <jbrunet@baylibre.com>
To: Mark Brown <broonie@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Kevin Hilman <khilman@baylibre.com>
Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org,
linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org,
Jerome Brunet <jbrunet@baylibre.com>
Subject: [PATCH 1/2] ASoC: soc-core: defer card registration if codec component is missing
Date: Wed, 26 Jun 2019 15:36:16 +0200 [thread overview]
Message-ID: <20190626133617.25959-2-jbrunet@baylibre.com> (raw)
In-Reply-To: <20190626133617.25959-1-jbrunet@baylibre.com>
Like cpus and platforms, defer sound card initialization if the codec
component is missing when initializing the dai_link
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
sound/soc/soc-core.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 358f1fbf9a30..002ddbf4e5a3 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1064,12 +1064,20 @@ static int soc_init_dai_link(struct snd_soc_card *card,
link->name);
return -EINVAL;
}
+
/* Codec DAI name must be specified */
if (!codec->dai_name) {
dev_err(card->dev, "ASoC: codec_dai_name not set for %s\n",
link->name);
return -EINVAL;
}
+
+ /*
+ * Defer card registartion if codec component is not added to
+ * component list.
+ */
+ if (!soc_find_component(codec))
+ return -EPROBE_DEFER;
}
/*
--
2.21.0
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next prev parent reply other threads:[~2019-06-26 13:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-26 13:36 [PATCH 0/2] ASoC: soc-core: update dai_link init Jerome Brunet
2019-06-26 13:36 ` Jerome Brunet [this message]
2019-06-26 21:20 ` [alsa-devel] [PATCH 1/2] ASoC: soc-core: defer card registration if codec component is missing Pierre-Louis Bossart
2019-06-26 13:36 ` [PATCH 2/2] ASoC: soc-core: support dai_link with platforms_num != 1 Jerome Brunet
2019-06-26 23:44 ` 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=20190626133617.25959-2-jbrunet@baylibre.com \
--to=jbrunet@baylibre.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=khilman@baylibre.com \
--cc=lgirdwood@gmail.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®