aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2010-08-18 15:20:55 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-08-20 09:26:45 -0400
commit26b01ccdc8ded270a1a65721b99acacf0c44e088 (patch)
tree8d4f415650f822002d8856c4912fa6f5d0267671 /sound/soc/soc-core.c
parent27ef3744f85bbbd00175ce7e9ac46b52089ee83c (diff)
ASoC: Don't call DAI registration for CODECs with no DAI
Otherwise we generate worrying (but benign) warnings for amps. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 7093c1787128..65352c7d4b7f 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3122,10 +3122,12 @@ int snd_soc_register_codec(struct device *dev,
3122 fixup_codec_formats(&dai_drv[i].capture); 3122 fixup_codec_formats(&dai_drv[i].capture);
3123 } 3123 }
3124 3124
3125 /* register DAIs */ 3125 /* register any DAIs */
3126 ret = snd_soc_register_dais(dev, dai_drv, num_dai); 3126 if (num_dai) {
3127 if (ret < 0) 3127 ret = snd_soc_register_dais(dev, dai_drv, num_dai);
3128 if (ret < 0)
3128 goto error; 3129 goto error;
3130 }
3129 3131
3130 mutex_lock(&client_mutex); 3132 mutex_lock(&client_mutex);
3131 list_add(&codec->list, &codec_list); 3133 list_add(&codec->list, &codec_list);
@@ -3164,8 +3166,9 @@ void snd_soc_unregister_codec(struct device *dev)
3164 return; 3166 return;
3165 3167
3166found: 3168found:
3167 for (i = 0; i < codec->num_dai; i++) 3169 if (codec->num_dai)
3168 snd_soc_unregister_dai(dev); 3170 for (i = 0; i < codec->num_dai; i++)
3171 snd_soc_unregister_dai(dev);
3169 3172
3170 mutex_lock(&client_mutex); 3173 mutex_lock(&client_mutex);
3171 list_del(&codec->list); 3174 list_del(&codec->list);