aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-03-31 18:24:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-01 11:59:26 -0400
commit62da659a7057f7227a99a42eea6aa606b09c1e8c (patch)
tree580881d892f50d919ae885e9e7cc220be66b8868 /drivers/rtc
parenta216685818a54b4f15235068b53908f954850251 (diff)
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>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-wm8350.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-wm8350.c b/drivers/rtc/rtc-wm8350.c
index 616630d1e317..c91edc572eb6 100644
--- a/drivers/rtc/rtc-wm8350.c
+++ b/drivers/rtc/rtc-wm8350.c
@@ -122,7 +122,7 @@ static int wm8350_rtc_settime(struct device *dev, struct rtc_time *tm)
122 do { 122 do {
123 rtc_ctrl = wm8350_reg_read(wm8350, WM8350_RTC_TIME_CONTROL); 123 rtc_ctrl = wm8350_reg_read(wm8350, WM8350_RTC_TIME_CONTROL);
124 schedule_timeout_uninterruptible(msecs_to_jiffies(1)); 124 schedule_timeout_uninterruptible(msecs_to_jiffies(1));
125 } while (retries-- && !(rtc_ctrl & WM8350_RTC_STS)); 125 } while (--retries && !(rtc_ctrl & WM8350_RTC_STS));
126 126
127 if (!retries) { 127 if (!retries) {
128 dev_err(dev, "timed out on set confirmation\n"); 128 dev_err(dev, "timed out on set confirmation\n");
@@ -437,7 +437,7 @@ static int wm8350_rtc_probe(struct platform_device *pdev)
437 do { 437 do {
438 timectl = wm8350_reg_read(wm8350, 438 timectl = wm8350_reg_read(wm8350,
439 WM8350_RTC_TIME_CONTROL); 439 WM8350_RTC_TIME_CONTROL);
440 } while (timectl & WM8350_RTC_STS && retries--); 440 } while (timectl & WM8350_RTC_STS && --retries);
441 441
442 if (retries == 0) { 442 if (retries == 0) {
443 dev_err(&pdev->dev, "failed to start: timeout\n"); 443 dev_err(&pdev->dev, "failed to start: timeout\n");