* [PATCH] ASoC: soc-core: use snd_soc_register_dais() on codec
@ 2013-02-25 8:40 Kuninori Morimoto
2013-03-02 3:51 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Kuninori Morimoto @ 2013-02-25 8:40 UTC (permalink / raw)
To: Mark Brown; +Cc: Linux-ALSA, Simon, Liam Girdwood, Kuninori Morimoto
snd_soc_register_dais() considers dai counts inside.
snd_soc_register_codec() does not need to care for it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
sound/soc/soc-core.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index ceac893..5f44d22 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -4047,11 +4047,10 @@ int snd_soc_register_codec(struct device *dev,
mutex_unlock(&client_mutex);
/* register any DAIs */
- if (num_dai) {
- ret = snd_soc_register_dais(dev, dai_drv, num_dai);
- if (ret < 0)
- dev_err(codec->dev, "ASoC: Failed to regster"
- " DAIs: %d\n", ret);
+ ret = snd_soc_register_dais(dev, dai_drv, num_dai);
+ if (ret < 0) {
+ dev_err(codec->dev, "ASoC: Failed to regster DAIs: %d\n", ret);
+ goto fail_codec_name;
}
dev_dbg(codec->dev, "ASoC: Registered codec '%s'\n", codec->name);
@@ -4073,7 +4072,6 @@ EXPORT_SYMBOL_GPL(snd_soc_register_codec);
void snd_soc_unregister_codec(struct device *dev)
{
struct snd_soc_codec *codec;
- int i;
list_for_each_entry(codec, &codec_list, list) {
if (dev == codec->dev)
@@ -4082,9 +4080,7 @@ void snd_soc_unregister_codec(struct device *dev)
return;
found:
- if (codec->num_dai)
- for (i = 0; i < codec->num_dai; i++)
- snd_soc_unregister_dai(dev);
+ snd_soc_unregister_dais(dev, codec->num_dai);
mutex_lock(&client_mutex);
list_del(&codec->list);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: soc-core: use snd_soc_register_dais() on codec
2013-02-25 8:40 [PATCH] ASoC: soc-core: use snd_soc_register_dais() on codec Kuninori Morimoto
@ 2013-03-02 3:51 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2013-03-02 3:51 UTC (permalink / raw)
To: Kuninori Morimoto; +Cc: Linux-ALSA, Simon, Liam Girdwood, Kuninori Morimoto
[-- Attachment #1.1: Type: text/plain, Size: 197 bytes --]
On Mon, Feb 25, 2013 at 12:40:40AM -0800, Kuninori Morimoto wrote:
> snd_soc_register_dais() considers dai counts inside.
> snd_soc_register_codec() does not need to care for it.
Applied, thanks.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-03-02 3:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-25 8:40 [PATCH] ASoC: soc-core: use snd_soc_register_dais() on codec Kuninori Morimoto
2013-03-02 3:51 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.