diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-03-01 14:11:58 -0500 |
---|---|---|
committer | Samuel Ortiz <samuel@sortiz.org> | 2009-04-04 18:32:24 -0400 |
commit | f3df0b7533ccad7bb3ef25383fea9c990b0033a2 (patch) | |
tree | fcf1bd6c65836b115dde16ac2afd53d763fc03f4 /drivers/mfd | |
parent | 3446d4bb93b4d8c7c5b667dd0271669f012fb166 (diff) |
mfd: Use the value of the final spin when reading the AUXADC
Reverse the order of the tests for loop exit so we use a valid value
before we time out. Vanishingly unlikely to happen since we retry for
several times the expected conversion time.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/wm8350-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mfd/wm8350-core.c b/drivers/mfd/wm8350-core.c index a285cc0cc704..c2be3088e2e1 100644 --- a/drivers/mfd/wm8350-core.c +++ b/drivers/mfd/wm8350-core.c | |||
@@ -1111,7 +1111,7 @@ int wm8350_read_auxadc(struct wm8350 *wm8350, int channel, int scale, int vref) | |||
1111 | do { | 1111 | do { |
1112 | schedule_timeout_interruptible(1); | 1112 | schedule_timeout_interruptible(1); |
1113 | reg = wm8350_reg_read(wm8350, WM8350_DIGITISER_CONTROL_1); | 1113 | reg = wm8350_reg_read(wm8350, WM8350_DIGITISER_CONTROL_1); |
1114 | } while (--tries && (reg & WM8350_AUXADC_POLL)); | 1114 | } while ((reg & WM8350_AUXADC_POLL) && --tries); |
1115 | 1115 | ||
1116 | if (!tries) | 1116 | if (!tries) |
1117 | dev_err(wm8350->dev, "adc chn %d read timeout\n", channel); | 1117 | dev_err(wm8350->dev, "adc chn %d read timeout\n", channel); |