aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2008-11-06 15:53:18 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-11-06 18:41:17 -0500
commit9e3a4afd5a66f9047e30ba225525e6ff01612dc4 (patch)
tree1f32bb96e97fb7ad4a0fc94b096cc30e308870ab /drivers/rtc
parenta564738c1c9c7b9ed696bf4116267789201ac8ac (diff)
rtc: fix handling of missing tm_year data when reading alarms
When fixing up invalid years rtc_read_alarm() was calling rtc_valid_tm() as a boolean but rtc_valid_tm() returns zero on success or a negative number if the time is not valid so the test was inverted. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> 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/interface.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index 7af60b98d8a4..a04c1b6b1575 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -271,7 +271,7 @@ int rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
271 dev_dbg(&rtc->dev, "alarm rollover: %s\n", "year"); 271 dev_dbg(&rtc->dev, "alarm rollover: %s\n", "year");
272 do { 272 do {
273 alarm->time.tm_year++; 273 alarm->time.tm_year++;
274 } while (!rtc_valid_tm(&alarm->time)); 274 } while (rtc_valid_tm(&alarm->time) != 0);
275 break; 275 break;
276 276
277 default: 277 default: