diff mbox

rtc-wm8350: retries will reaches -1

Message ID 4981CF35.7090003@gmail.com
State Superseded, archived
Headers show

Commit Message

roel kluin Jan. 29, 2009, 3:45 p.m. UTC
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>
---

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
-~----------~----~----~----~------~----~------~--~---

Comments

Mark Brown Jan. 29, 2009, 6:35 p.m. UTC | #1
On Thu, Jan 29, 2009 at 04:45:57PM +0100, Roel Kluin wrote:

> 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>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
-~----------~----~----~----~------~----~------~--~---
diff mbox

Patch

diff --git a/drivers/rtc/rtc-wm8350.c b/drivers/rtc/rtc-wm8350.c
index 5c5e3aa..58296e9 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)
 	do {
 		rtc_ctrl = wm8350_reg_read(wm8350, WM8350_RTC_TIME_CONTROL);
 		schedule_timeout_uninterruptible(msecs_to_jiffies(1));
-	} while (retries-- && !(rtc_ctrl & WM8350_RTC_STS));
+	} while (--retries && !(rtc_ctrl & WM8350_RTC_STS));
 
 	if (!retries) {
 		dev_err(dev, "timed out on set confirmation\n");