rtc-wm8350: retries will reach -1

With a postfix decrement retries will reach -1 rather than 0, so the
warning and error-out will not occur.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Roel Kluin 2009-03-31 15:24:59 -07:00 коммит произвёл Linus Torvalds
Родитель a216685818
Коммит 62da659a70
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -122,7 +122,7 @@ static int wm8350_rtc_settime(struct device *dev, struct rtc_time *tm)
do { do {
rtc_ctrl = wm8350_reg_read(wm8350, WM8350_RTC_TIME_CONTROL); rtc_ctrl = wm8350_reg_read(wm8350, WM8350_RTC_TIME_CONTROL);
schedule_timeout_uninterruptible(msecs_to_jiffies(1)); schedule_timeout_uninterruptible(msecs_to_jiffies(1));
} while (retries-- && !(rtc_ctrl & WM8350_RTC_STS)); } while (--retries && !(rtc_ctrl & WM8350_RTC_STS));
if (!retries) { if (!retries) {
dev_err(dev, "timed out on set confirmation\n"); dev_err(dev, "timed out on set confirmation\n");
@ -437,7 +437,7 @@ static int wm8350_rtc_probe(struct platform_device *pdev)
do { do {
timectl = wm8350_reg_read(wm8350, timectl = wm8350_reg_read(wm8350,
WM8350_RTC_TIME_CONTROL); WM8350_RTC_TIME_CONTROL);
} while (timectl & WM8350_RTC_STS && retries--); } while (timectl & WM8350_RTC_STS && --retries);
if (retries == 0) { if (retries == 0) {
dev_err(&pdev->dev, "failed to start: timeout\n"); dev_err(&pdev->dev, "failed to start: timeout\n");