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>
This commit is contained in:
Mark Brown 2010-08-18 20:20:55 +01:00
parent 27ef3744f8
commit 26b01ccdc8
1 changed files with 8 additions and 5 deletions

View File

@ -3122,10 +3122,12 @@ int snd_soc_register_codec(struct device *dev,
fixup_codec_formats(&dai_drv[i].capture); fixup_codec_formats(&dai_drv[i].capture);
} }
/* register DAIs */ /* register any DAIs */
ret = snd_soc_register_dais(dev, dai_drv, num_dai); if (num_dai) {
if (ret < 0) ret = snd_soc_register_dais(dev, dai_drv, num_dai);
if (ret < 0)
goto error; goto error;
}
mutex_lock(&client_mutex); mutex_lock(&client_mutex);
list_add(&codec->list, &codec_list); list_add(&codec->list, &codec_list);
@ -3164,8 +3166,9 @@ void snd_soc_unregister_codec(struct device *dev)
return; return;
found: found:
for (i = 0; i < codec->num_dai; i++) if (codec->num_dai)
snd_soc_unregister_dai(dev); for (i = 0; i < codec->num_dai; i++)
snd_soc_unregister_dai(dev);
mutex_lock(&client_mutex); mutex_lock(&client_mutex);
list_del(&codec->list); list_del(&codec->list);