ALSA: atiixp - Fix wrong time-out checks during ac-link reset
authorTakashi Iwai <tiwai@suse.de>
Fri, 11 Mar 2011 14:45:32 +0000 (15:45 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 11 Mar 2011 14:45:32 +0000 (15:45 +0100)
The time-out in snd_atiixp_aclink_reset() is wrongly checked, and
it resulted in exiting from the loop at the first iteration.

Reported-by: Amir Shamsuddin <AmirS2+alsa@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/atiixp.c
sound/pci/atiixp_modem.c

index 49d572a7b235cd21dfc8a3f5d8069b728a9ec2dc..3119cd97a217e748a48cce8b211a964354de3fed 100644 (file)
@@ -522,7 +522,7 @@ static int snd_atiixp_aclink_reset(struct atiixp *chip)
                atiixp_read(chip, CMD);
                mdelay(1);
                atiixp_update(chip, CMD, ATI_REG_CMD_AC_RESET, ATI_REG_CMD_AC_RESET);
-               if (--timeout) {
+               if (!--timeout) {
                        snd_printk(KERN_ERR "atiixp: codec reset timeout\n");
                        break;
                }
index 91d7036b64118572a7c4ffa3ed20724e1ede6c00..2f74c2fdf1ea573fd2a596ed7f1005980942c3cb 100644 (file)
@@ -498,7 +498,7 @@ static int snd_atiixp_aclink_reset(struct atiixp_modem *chip)
                atiixp_read(chip, CMD);
                msleep(1);
                atiixp_update(chip, CMD, ATI_REG_CMD_AC_RESET, ATI_REG_CMD_AC_RESET);
-               if (--timeout) {
+               if (!--timeout) {
                        snd_printk(KERN_ERR "atiixp-modem: codec reset timeout\n");
                        break;
                }