Commit f3df0b75 authored by Mark Brown's avatar Mark Brown Committed by Samuel Ortiz

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: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@openedhand.com>
parent 3446d4bb
...@@ -1111,7 +1111,7 @@ int wm8350_read_auxadc(struct wm8350 *wm8350, int channel, int scale, int vref) ...@@ -1111,7 +1111,7 @@ int wm8350_read_auxadc(struct wm8350 *wm8350, int channel, int scale, int vref)
do { do {
schedule_timeout_interruptible(1); schedule_timeout_interruptible(1);
reg = wm8350_reg_read(wm8350, WM8350_DIGITISER_CONTROL_1); reg = wm8350_reg_read(wm8350, WM8350_DIGITISER_CONTROL_1);
} while (--tries && (reg & WM8350_AUXADC_POLL)); } while ((reg & WM8350_AUXADC_POLL) && --tries);
if (!tries) if (!tries)
dev_err(wm8350->dev, "adc chn %d read timeout\n", channel); dev_err(wm8350->dev, "adc chn %d read timeout\n", channel);
......
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