Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276375
b: refs/heads/master
c: 6a8943d
h: refs/heads/master
i:
  276373: 7f0f3be
  276371: ce09e06
  276367: d160019
v: v3
  • Loading branch information
Arve Hjønnevåg authored and John Stultz committed Nov 23, 2011
1 parent 04e9e1c commit cc03dc2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c0afabd3d553c521e003779c127143ffde55a16f
refs/heads/master: 6a8943d9ec2567572fca25cf69ad45844d0141a3
10 changes: 5 additions & 5 deletions trunk/drivers/rtc/class.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static int rtc_suspend(struct device *dev, pm_message_t mesg)
*/
delta = timespec_sub(old_system, old_rtc);
delta_delta = timespec_sub(delta, old_delta);
if (abs(delta_delta.tv_sec) >= 2) {
if (delta_delta.tv_sec < -2 || delta_delta.tv_sec >= 2) {
/*
* if delta_delta is too large, assume time correction
* has occured and set old_delta to the current delta.
Expand Down Expand Up @@ -100,9 +100,8 @@ static int rtc_resume(struct device *dev)
rtc_tm_to_time(&tm, &new_rtc.tv_sec);
new_rtc.tv_nsec = 0;

if (new_rtc.tv_sec <= old_rtc.tv_sec) {
if (new_rtc.tv_sec < old_rtc.tv_sec)
pr_debug("%s: time travel!\n", dev_name(&rtc->dev));
if (new_rtc.tv_sec < old_rtc.tv_sec) {
pr_debug("%s: time travel!\n", dev_name(&rtc->dev));
return 0;
}

Expand All @@ -119,7 +118,8 @@ static int rtc_resume(struct device *dev)
sleep_time = timespec_sub(sleep_time,
timespec_sub(new_system, old_system));

timekeeping_inject_sleeptime(&sleep_time);
if (sleep_time.tv_sec >= 0)
timekeeping_inject_sleeptime(&sleep_time);
return 0;
}

Expand Down

0 comments on commit cc03dc2

Please sign in to comment.