From 099ffe251c72ef9d01f3fbc523ce2eb2bd21b5f8 Mon Sep 17 00:00:00 2001 From: Roel Kluin Date: Tue, 31 Mar 2009 15:25:00 -0700 Subject: [PATCH] --- yaml --- r: 139241 b: refs/heads/master c: fa7af8b1bb6dfca7a0c8541683a9bfffbc8dd345 h: refs/heads/master i: 139239: cdad458f4df2e995cbfd942ddb3358b6fecaf42b v: v3 --- [refs] | 2 +- trunk/drivers/rtc/rtc-ds1374.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index d50a628f5994..1403d59f4f55 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c08cf9daf66844c60ebe9f89885d3a3e1893e61f +refs/heads/master: fa7af8b1bb6dfca7a0c8541683a9bfffbc8dd345 diff --git a/trunk/drivers/rtc/rtc-ds1374.c b/trunk/drivers/rtc/rtc-ds1374.c index a5b0fc09f0c6..4d32e328f6cd 100644 --- a/trunk/drivers/rtc/rtc-ds1374.c +++ b/trunk/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);