]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ASoC: AIC23: Fixing infinite loop in resume path
authorAnuj Aggarwal <anuj.aggarwal@ti.com>
Fri, 27 Nov 2009 12:10:58 +0000 (17:40 +0530)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 8 Dec 2009 18:21:39 +0000 (10:21 -0800)
commit e9ff5eb2ae018fe2298c68746c873bf828c6b10e upstream.

This patch fixes two issues:
a) Infinite loop in resume function
b) Writes to non-existing registers in resume function

Signed-off-by: Anuj Aggarwal <anuj.aggarwal@ti.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
sound/soc/codecs/tlv320aic23.c

index 0b8dcb5cd729281bfd80264acdb5a58b9025636e..1365de0f7aeca2879c38e1919d587b99d3b6c714 100644 (file)
@@ -625,11 +625,10 @@ static int tlv320aic23_resume(struct platform_device *pdev)
 {
        struct snd_soc_device *socdev = platform_get_drvdata(pdev);
        struct snd_soc_codec *codec = socdev->card->codec;
-       int i;
        u16 reg;
 
        /* Sync reg_cache with the hardware */
-       for (reg = 0; reg < ARRAY_SIZE(tlv320aic23_reg); i++) {
+       for (reg = 0; reg < TLV320AIC23_RESET; reg++) {
                u16 val = tlv320aic23_read_reg_cache(codec, reg);
                tlv320aic23_write(codec, reg, val);
        }