Merge tag 'vfio-v3.16-rc1' of git://github.com/awilliam/linux-vfio into next
[firefly-linux-kernel-4.4.55.git] / sound / soc / soc-cache.c
index bfed3e4c45ffa708910e580bf02359a7b6b3c509..00e70b6c7da2ea78e622ca3d0ce36360f3ede593 100644 (file)
@@ -72,6 +72,9 @@ int snd_soc_cache_init(struct snd_soc_codec *codec)
 
        reg_size = codec_drv->reg_cache_size * codec_drv->reg_word_size;
 
+       if (!reg_size)
+               return 0;
+
        mutex_init(&codec->cache_rw_mutex);
 
        dev_dbg(codec->dev, "ASoC: Initializing cache for %s codec\n",
@@ -162,8 +165,6 @@ static int snd_soc_flat_cache_sync(struct snd_soc_codec *codec)
                                                  i, codec_drv->reg_word_size) == val)
                                continue;
 
-               WARN_ON(!snd_soc_codec_writable_register(codec, i));
-
                ret = snd_soc_write(codec, i, val);
                if (ret)
                        return ret;