aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/soc-cache.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c
index 0e17b4050425..fc80be7dfd6a 100644
--- a/sound/soc/soc-cache.c
+++ b/sound/soc/soc-cache.c
@@ -1531,6 +1531,7 @@ static int snd_soc_flat_cache_init(struct snd_soc_codec *codec)
1531 1531
1532/* an array of all supported compression types */ 1532/* an array of all supported compression types */
1533static const struct snd_soc_cache_ops cache_types[] = { 1533static const struct snd_soc_cache_ops cache_types[] = {
1534 /* Flat *must* be the first entry for fallback */
1534 { 1535 {
1535 .id = SND_SOC_FLAT_COMPRESSION, 1536 .id = SND_SOC_FLAT_COMPRESSION,
1536 .name = "flat", 1537 .name = "flat",
@@ -1567,10 +1568,12 @@ int snd_soc_cache_init(struct snd_soc_codec *codec)
1567 for (i = 0; i < ARRAY_SIZE(cache_types); ++i) 1568 for (i = 0; i < ARRAY_SIZE(cache_types); ++i)
1568 if (cache_types[i].id == codec->compress_type) 1569 if (cache_types[i].id == codec->compress_type)
1569 break; 1570 break;
1571
1572 /* Fall back to flat compression */
1570 if (i == ARRAY_SIZE(cache_types)) { 1573 if (i == ARRAY_SIZE(cache_types)) {
1571 dev_err(codec->dev, "Could not match compress type: %d\n", 1574 dev_warn(codec->dev, "Could not match compress type: %d\n",
1572 codec->compress_type); 1575 codec->compress_type);
1573 return -EINVAL; 1576 i = 0;
1574 } 1577 }
1575 1578
1576 mutex_init(&codec->cache_rw_mutex); 1579 mutex_init(&codec->cache_rw_mutex);