]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ASoC: Use standard cache sync for WM8978
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 29 Dec 2011 11:32:09 +0000 (11:32 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 20 Jan 2012 13:58:19 +0000 (13:58 +0000)
Saves a bit of code and supports further refactoring.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/codecs/wm8978.c

index 051f5d0d37d6ae31a8529c16c21e2a697f3f2e24..0ab339c034e6dd5eadf99200607df906e0556df0 100644 (file)
@@ -891,16 +891,9 @@ static int wm8978_suspend(struct snd_soc_codec *codec)
 static int wm8978_resume(struct snd_soc_codec *codec)
 {
        struct wm8978_priv *wm8978 = snd_soc_codec_get_drvdata(codec);
-       int i;
-       u16 *cache = codec->reg_cache;
 
        /* Sync reg_cache with the hardware */
-       for (i = 0; i < ARRAY_SIZE(wm8978_reg); i++) {
-               if (i == WM8978_RESET)
-                       continue;
-               if (cache[i] != wm8978_reg[i])
-                       snd_soc_write(codec, i, cache[i]);
-       }
+       snd_soc_cache_sync(codec);
 
        wm8978_set_bias_level(codec, SND_SOC_BIAS_STANDBY);