Skip to content

Commit

Permalink
ASoC: soc-core: Simplify compress_type overriding functionality
Browse files Browse the repository at this point in the history
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Dimitris Papastamos authored and Mark Brown committed Jan 11, 2011
1 parent 1321e88 commit 861f2fa
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1748,6 +1748,8 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
list_for_each_entry(codec, &codec_list, list) {
if (codec->cache_init)
continue;
/* by default we don't override the compress_type */
compress_type = 0;
/* check to see if we need to override the compress_type */
for (i = 0; i < card->num_configs; ++i) {
codec_conf = &card->codec_conf[i];
Expand All @@ -1758,18 +1760,6 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
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);
if (ret < 0) {
mutex_unlock(&card->mutex);
Expand Down

0 comments on commit 861f2fa

Please sign in to comment.