X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=sound%2Fsoc%2Fsoc-cache.c;h=00e70b6c7da2ea78e622ca3d0ce36360f3ede593;hb=a68a7509d3af8ee458d32b2416b0c2aaf2a4a7e3;hp=bfed3e4c45ffa708910e580bf02359a7b6b3c509;hpb=0214196ce0e941256797bf54b2fcf1450452df2a;p=firefly-linux-kernel-4.4.55.git diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c index bfed3e4c45ff..00e70b6c7da2 100644 --- a/sound/soc/soc-cache.c +++ b/sound/soc/soc-cache.c @@ -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;