summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-ds1374.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2009-04-03 00:22:11 +0200
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-04-03 00:22:11 +0200
commitcd02938a828f4b2098a074afb7454f106f2e8df5 (patch)
tree7b543fd6aa82a62dc3a9614c26f89daca83e77d5 /drivers/rtc/rtc-ds1374.c
parent[ARM] 5444/1: ARM: Realview: Fix event-device multiplicators in localtimer.c (diff)
parentARM: Add SMSC911X support to Overo platform (V2) (diff)
downloadlinux-cd02938a828f4b2098a074afb7454f106f2e8df5.tar.xz
linux-cd02938a828f4b2098a074afb7454f106f2e8df5.zip
Merge branch 'smsc911x-armplatforms' of git://github.com/steveglen/linux-2.6
Diffstat (limited to 'drivers/rtc/rtc-ds1374.c')
-rw-r--r--drivers/rtc/rtc-ds1374.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/rtc/rtc-ds1374.c b/drivers/rtc/rtc-ds1374.c
index a5b0fc09f0c6..4d32e328f6cd 100644
--- a/drivers/rtc/rtc-ds1374.c
+++ b/drivers/rtc/rtc-ds1374.c
@@ -222,16 +222,16 @@ static int ds1374_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
rtc_tm_to_time(&alarm->time, &new_alarm);
rtc_tm_to_time(&now, &itime);
- new_alarm -= itime;
-
/* This can happen due to races, in addition to dates that are
* truly in the past. To avoid requiring the caller to check for
* races, dates in the past are assumed to be in the recent past
* (i.e. not something that we'd rather the caller know about via
* an error), and the alarm is set to go off as soon as possible.
*/
- if (new_alarm <= 0)
+ if (time_before_eq(new_alarm, itime))
new_alarm = 1;
+ else
+ new_alarm -= itime;
mutex_lock(&ds1374->mutex);