Commit 7e79443c authored by Takashi Iwai's avatar Takashi Iwai

ALSA: atiixp - Fix wrong time-out checks during ac-link reset

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: default avatarAmir Shamsuddin <AmirS2+alsa@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 966a7f0d
...@@ -522,7 +522,7 @@ static int snd_atiixp_aclink_reset(struct atiixp *chip) ...@@ -522,7 +522,7 @@ static int snd_atiixp_aclink_reset(struct atiixp *chip)
atiixp_read(chip, CMD); atiixp_read(chip, CMD);
mdelay(1); mdelay(1);
atiixp_update(chip, CMD, ATI_REG_CMD_AC_RESET, ATI_REG_CMD_AC_RESET); 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"); snd_printk(KERN_ERR "atiixp: codec reset timeout\n");
break; break;
} }
......
...@@ -498,7 +498,7 @@ static int snd_atiixp_aclink_reset(struct atiixp_modem *chip) ...@@ -498,7 +498,7 @@ static int snd_atiixp_aclink_reset(struct atiixp_modem *chip)
atiixp_read(chip, CMD); atiixp_read(chip, CMD);
msleep(1); msleep(1);
atiixp_update(chip, CMD, ATI_REG_CMD_AC_RESET, ATI_REG_CMD_AC_RESET); 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"); snd_printk(KERN_ERR "atiixp-modem: codec reset timeout\n");
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment