summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2013-02-25 00:40:40 -0800
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-03-04 11:07:43 +0800
commit5acd7dfbd7851446fb1d2c947661d365e4c635a0 (patch)
treee0cc2b1a36999880504d2d1168b206ab0852fed1 /sound/soc/soc-core.c
parentf790b94d7867fb0555f91ae920b9001b42ae38a6 (diff)
downloadtalos-obmc-linux-5acd7dfbd7851446fb1d2c947661d365e4c635a0.tar.gz
talos-obmc-linux-5acd7dfbd7851446fb1d2c947661d365e4c635a0.zip
ASoC: core: use snd_soc_register_dais() on codec
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> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index a872be1ee44d..e02c374d2243 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -4086,11 +4086,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);
@@ -4112,7 +4111,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)
@@ -4121,9 +4119,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);
OpenPOWER on IntegriCloud