ASoC: cache: Fix error code when not using ASoC level cache
authorMark Brown <broonie@linaro.org>
Mon, 2 Jun 2014 15:08:21 +0000 (16:08 +0100)
committerMark Brown <broonie@linaro.org>
Mon, 2 Jun 2014 15:08:21 +0000 (16:08 +0100)
It is not an error to have no cache so we shouldn't return an error code
and cause our callers to fail, just silently do nothing instead.  Thanks
to Jarkko for identify the problematic commit.

Reported-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Reported-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/soc-cache.c

index 8fff5b6d86dbf12844367414caec1cb443942919..00e70b6c7da2ea78e622ca3d0ce36360f3ede593 100644 (file)
@@ -73,7 +73,7 @@ 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 -EINVAL;
+               return 0;
 
        mutex_init(&codec->cache_rw_mutex);