Skip to content

Commit

Permalink
mfd: Use the value of the final spin when reading the AUXADC
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Brown authored and Samuel Ortiz committed Apr 4, 2009
1 parent 3446d4b commit f3df0b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mfd/wm8350-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ int wm8350_read_auxadc(struct wm8350 *wm8350, int channel, int scale, int vref)
do {
schedule_timeout_interruptible(1);
reg = wm8350_reg_read(wm8350, WM8350_DIGITISER_CONTROL_1);
} while (--tries && (reg & WM8350_AUXADC_POLL));
} while ((reg & WM8350_AUXADC_POLL) && --tries);

if (!tries)
dev_err(wm8350->dev, "adc chn %d read timeout\n", channel);
Expand Down

0 comments on commit f3df0b7

Please sign in to comment.