diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2013-02-25 03:40:40 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-03-03 22:07:43 -0500 |
commit | 5acd7dfbd7851446fb1d2c947661d365e4c635a0 (patch) | |
tree | e0cc2b1a36999880504d2d1168b206ab0852fed1 | |
parent | f790b94d7867fb0555f91ae920b9001b42ae38a6 (diff) |
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>
-rw-r--r-- | sound/soc/soc-core.c | 14 |
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, | |||
4086 | mutex_unlock(&client_mutex); | 4086 | mutex_unlock(&client_mutex); |
4087 | 4087 | ||
4088 | /* register any DAIs */ | 4088 | /* register any DAIs */ |
4089 | if (num_dai) { | 4089 | ret = snd_soc_register_dais(dev, dai_drv, num_dai); |
4090 | ret = snd_soc_register_dais(dev, dai_drv, num_dai); | 4090 | if (ret < 0) { |
4091 | if (ret < 0) | 4091 | dev_err(codec->dev, "ASoC: Failed to regster DAIs: %d\n", ret); |
4092 | dev_err(codec->dev, "ASoC: Failed to regster" | 4092 | goto fail_codec_name; |
4093 | " DAIs: %d\n", ret); | ||
4094 | } | 4093 | } |
4095 | 4094 | ||
4096 | dev_dbg(codec->dev, "ASoC: Registered codec '%s'\n", codec->name); | 4095 | dev_dbg(codec->dev, "ASoC: Registered codec '%s'\n", codec->name); |
@@ -4112,7 +4111,6 @@ EXPORT_SYMBOL_GPL(snd_soc_register_codec); | |||
4112 | void snd_soc_unregister_codec(struct device *dev) | 4111 | void snd_soc_unregister_codec(struct device *dev) |
4113 | { | 4112 | { |
4114 | struct snd_soc_codec *codec; | 4113 | struct snd_soc_codec *codec; |
4115 | int i; | ||
4116 | 4114 | ||
4117 | list_for_each_entry(codec, &codec_list, list) { | 4115 | list_for_each_entry(codec, &codec_list, list) { |
4118 | if (dev == codec->dev) | 4116 | if (dev == codec->dev) |
@@ -4121,9 +4119,7 @@ void snd_soc_unregister_codec(struct device *dev) | |||
4121 | return; | 4119 | return; |
4122 | 4120 | ||
4123 | found: | 4121 | found: |
4124 | if (codec->num_dai) | 4122 | snd_soc_unregister_dais(dev, codec->num_dai); |
4125 | for (i = 0; i < codec->num_dai; i++) | ||
4126 | snd_soc_unregister_dai(dev); | ||
4127 | 4123 | ||
4128 | mutex_lock(&client_mutex); | 4124 | mutex_lock(&client_mutex); |
4129 | list_del(&codec->list); | 4125 | list_del(&codec->list); |