diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-07-12 20:20:10 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-07-13 05:32:18 -0400 |
commit | 33e319fba727708ee45fec70091c498da4e8f606 (patch) | |
tree | f1531b28e12eb2214262c6be052e402ef458db62 /sound/soc/codecs/stac9766.c | |
parent | cc369cf504c51d36765e18b0c28a09a92d28ed79 (diff) |
ASoC: Keep index within stac9766_reg[]
Keep index within stac9766_reg[]
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/stac9766.c')
-rw-r--r-- | sound/soc/codecs/stac9766.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/codecs/stac9766.c b/sound/soc/codecs/stac9766.c index 8ad4b7b3e3ba..befc6488c39a 100644 --- a/sound/soc/codecs/stac9766.c +++ b/sound/soc/codecs/stac9766.c | |||
@@ -149,7 +149,7 @@ static int stac9766_ac97_write(struct snd_soc_codec *codec, unsigned int reg, | |||
149 | stac9766_ac97_write(codec, AC97_INT_PAGING, 1); | 149 | stac9766_ac97_write(codec, AC97_INT_PAGING, 1); |
150 | return 0; | 150 | return 0; |
151 | } | 151 | } |
152 | if (reg / 2 > ARRAY_SIZE(stac9766_reg)) | 152 | if (reg / 2 >= ARRAY_SIZE(stac9766_reg)) |
153 | return -EIO; | 153 | return -EIO; |
154 | 154 | ||
155 | soc_ac97_ops.write(codec->ac97, reg, val); | 155 | soc_ac97_ops.write(codec->ac97, reg, val); |
@@ -168,7 +168,7 @@ static unsigned int stac9766_ac97_read(struct snd_soc_codec *codec, | |||
168 | stac9766_ac97_write(codec, AC97_INT_PAGING, 1); | 168 | stac9766_ac97_write(codec, AC97_INT_PAGING, 1); |
169 | return val; | 169 | return val; |
170 | } | 170 | } |
171 | if (reg / 2 > ARRAY_SIZE(stac9766_reg)) | 171 | if (reg / 2 >= ARRAY_SIZE(stac9766_reg)) |
172 | return -EIO; | 172 | return -EIO; |
173 | 173 | ||
174 | if (reg == AC97_RESET || reg == AC97_GPIO_STATUS || | 174 | if (reg == AC97_RESET || reg == AC97_GPIO_STATUS || |