From 36f86f2b57a9ada78c90d5bfae81a1b8e71ab37f Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Tue, 28 Dec 2010 21:37:56 +0100 Subject: [PATCH] --- yaml --- r: 223711 b: refs/heads/master c: d24eb0db9c8a7ceecae860bdc636ed1e8a86943a h: refs/heads/master i: 223709: 9fed61275a49c43736a5366cc4662a4ded4e5d69 223707: 51e6dad136ac33fdc3d778d025dcb689970cf815 223703: 5d77ba2532dd9f04fb4e49589642f642e5282e60 223695: 0bf26b2ce294b7ab7b7b196572de8a4504b6084f 223679: 0f2052efeb2d56a46868cfb455a99b0ab6909806 v: v3 --- [refs] | 2 +- trunk/sound/soc/codecs/max98088.c | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 4818328e9722..45baed734eb2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7f984b55acb6530bf854bfcac13104228f3336c1 +refs/heads/master: d24eb0db9c8a7ceecae860bdc636ed1e8a86943a diff --git a/trunk/sound/soc/codecs/max98088.c b/trunk/sound/soc/codecs/max98088.c index d63e28773eb1..6447dbb2f123 100644 --- a/trunk/sound/soc/codecs/max98088.c +++ b/trunk/sound/soc/codecs/max98088.c @@ -40,7 +40,6 @@ struct max98088_cdata { }; struct max98088_priv { - u8 reg_cache[M98088_REG_CNT]; enum max98088_type devtype; void *control_data; struct max98088_pdata *pdata; @@ -1588,7 +1587,7 @@ static int max98088_dai2_set_fmt(struct snd_soc_dai *codec_dai, static void max98088_sync_cache(struct snd_soc_codec *codec) { - struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec); + u16 *reg_cache = codec->reg_cache; int i; if (!codec->cache_sync) @@ -1599,14 +1598,14 @@ static void max98088_sync_cache(struct snd_soc_codec *codec) /* write back cached values if they're writeable and * different from the hardware default. */ - for (i = 1; i < ARRAY_SIZE(max98088->reg_cache); i++) { + for (i = 1; i < codec->driver->reg_cache_size; i++) { if (!max98088_access[i].writable) continue; - if (max98088->reg_cache[i] == max98088_reg[i]) + if (reg_cache[i] == max98088_reg[i]) continue; - snd_soc_write(codec, i, max98088->reg_cache[i]); + snd_soc_write(codec, i, reg_cache[i]); } codec->cache_sync = 0; @@ -1951,7 +1950,6 @@ static int max98088_probe(struct snd_soc_codec *codec) int ret = 0; codec->cache_sync = 1; - memcpy(codec->reg_cache, max98088_reg, sizeof(max98088_reg)); ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_I2C); if (ret != 0) {