Commit 861f2faf authored by Dimitris Papastamos's avatar Dimitris Papastamos Committed by Mark Brown

ASoC: soc-core: Simplify compress_type overriding functionality

Signed-off-by: default avatarDimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 1321e883
...@@ -1748,6 +1748,8 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card) ...@@ -1748,6 +1748,8 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
list_for_each_entry(codec, &codec_list, list) { list_for_each_entry(codec, &codec_list, list) {
if (codec->cache_init) if (codec->cache_init)
continue; continue;
/* by default we don't override the compress_type */
compress_type = 0;
/* check to see if we need to override the compress_type */ /* check to see if we need to override the compress_type */
for (i = 0; i < card->num_configs; ++i) { for (i = 0; i < card->num_configs; ++i) {
codec_conf = &card->codec_conf[i]; codec_conf = &card->codec_conf[i];
...@@ -1758,18 +1760,6 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card) ...@@ -1758,18 +1760,6 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
break; break;
} }
} }
if (i == card->num_configs) {
/* no need to override the compress_type so
* go ahead and do the standard thing */
ret = snd_soc_init_codec_cache(codec, 0);
if (ret < 0) {
mutex_unlock(&card->mutex);
return;
}
continue;
}
/* override the compress_type with the one supplied in
* the machine driver */
ret = snd_soc_init_codec_cache(codec, compress_type); ret = snd_soc_init_codec_cache(codec, compress_type);
if (ret < 0) { if (ret < 0) {
mutex_unlock(&card->mutex); mutex_unlock(&card->mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment