diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-01-12 18:17:24 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-01-25 16:18:05 -0500 |
commit | 69058cd6d10423126ab6aeb568f4af2bd34c49fe (patch) | |
tree | 45cdde9f2ec83788b35948b184d5aeac45ddd6a5 /sound/arm | |
parent | fd015480c29deb52ae3bfaf41e888c450765edd8 (diff) |
ALSA: AACI: fix timeout condition checking
Ensure that a timeout coincident with the condition being waited for
results in success rather than failure. This helps avoid timeout
conditions being inappropriately flagged.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'sound/arm')
-rw-r--r-- | sound/arm/aaci.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c index 91acc9a243ec..21ff6296d160 100644 --- a/sound/arm/aaci.c +++ b/sound/arm/aaci.c | |||
@@ -88,7 +88,7 @@ static void aaci_ac97_write(struct snd_ac97 *ac97, unsigned short reg, | |||
88 | v = readl(aaci->base + AACI_SLFR); | 88 | v = readl(aaci->base + AACI_SLFR); |
89 | } while ((v & (SLFR_1TXB|SLFR_2TXB)) && --timeout); | 89 | } while ((v & (SLFR_1TXB|SLFR_2TXB)) && --timeout); |
90 | 90 | ||
91 | if (!timeout) | 91 | if (v & (SLFR_1TXB|SLFR_2TXB)) |
92 | dev_err(&aaci->dev->dev, | 92 | dev_err(&aaci->dev->dev, |
93 | "timeout waiting for write to complete\n"); | 93 | "timeout waiting for write to complete\n"); |
94 | 94 | ||
@@ -124,7 +124,7 @@ static unsigned short aaci_ac97_read(struct snd_ac97 *ac97, unsigned short reg) | |||
124 | v = readl(aaci->base + AACI_SLFR); | 124 | v = readl(aaci->base + AACI_SLFR); |
125 | } while ((v & SLFR_1TXB) && --timeout); | 125 | } while ((v & SLFR_1TXB) && --timeout); |
126 | 126 | ||
127 | if (!timeout) { | 127 | if (v & SLFR_1TXB) { |
128 | dev_err(&aaci->dev->dev, "timeout on slot 1 TX busy\n"); | 128 | dev_err(&aaci->dev->dev, "timeout on slot 1 TX busy\n"); |
129 | v = ~0; | 129 | v = ~0; |
130 | goto out; | 130 | goto out; |
@@ -145,7 +145,7 @@ static unsigned short aaci_ac97_read(struct snd_ac97 *ac97, unsigned short reg) | |||
145 | v = readl(aaci->base + AACI_SLFR) & (SLFR_1RXV|SLFR_2RXV); | 145 | v = readl(aaci->base + AACI_SLFR) & (SLFR_1RXV|SLFR_2RXV); |
146 | } while ((v != (SLFR_1RXV|SLFR_2RXV)) && --timeout); | 146 | } while ((v != (SLFR_1RXV|SLFR_2RXV)) && --timeout); |
147 | 147 | ||
148 | if (!timeout) { | 148 | if (v != (SLFR_1RXV|SLFR_2RXV)) { |
149 | dev_err(&aaci->dev->dev, "timeout on RX valid\n"); | 149 | dev_err(&aaci->dev->dev, "timeout on RX valid\n"); |
150 | v = ~0; | 150 | v = ~0; |
151 | goto out; | 151 | goto out; |