Skip to content

Commit

Permalink
ASoC: nuc900: Fix a loop timeout test
Browse files Browse the repository at this point in the history
We should be finishing the loop with timeout set to zero but because
this is a post-op we finish with timeout == -1.

Fixes: 1082e27 ("ASoC: NUC900/audio: add nuc900 audio driver support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Dan Carpenter authored and Mark Brown committed Dec 11, 2017
1 parent cd430a2 commit 65a12b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/soc/nuc900/nuc900-ac97.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static unsigned short nuc900_ac97_read(struct snd_ac97 *ac97,

/* polling the AC_R_FINISH */
while (!(AUDIO_READ(nuc900_audio->mmio + ACTL_ACCON) & AC_R_FINISH)
&& timeout--)
&& --timeout)
mdelay(1);

if (!timeout) {
Expand Down Expand Up @@ -121,7 +121,7 @@ static void nuc900_ac97_write(struct snd_ac97 *ac97, unsigned short reg,

/* polling the AC_W_FINISH */
while ((AUDIO_READ(nuc900_audio->mmio + ACTL_ACCON) & AC_W_FINISH)
&& timeout--)
&& --timeout)
mdelay(1);

if (!timeout)
Expand Down

0 comments on commit 65a12b3

Please sign in to comment.