]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/rtc/class.c
sched: cleanup: refactor common code of sleep_on / wait_for_completion
[linux-2.6-omap-h63xx.git] / drivers / rtc / class.c
index 8b3cd31d6a61898ae892539e84d7d3b8ebca6d39..10ab3b71ffc621694c509a4bc7582ef9468ccc54 100644 (file)
@@ -46,6 +46,7 @@ static int rtc_suspend(struct device *dev, pm_message_t mesg)
 {
        struct rtc_device       *rtc = to_rtc_device(dev);
        struct rtc_time         tm;
+       struct timespec         ts = current_kernel_time();
 
        if (strncmp(rtc->dev.bus_id,
                                CONFIG_RTC_HCTOSYS_DEVICE,
@@ -57,8 +58,8 @@ static int rtc_suspend(struct device *dev, pm_message_t mesg)
 
        /* RTC precision is 1 second; adjust delta for avg 1/2 sec err */
        set_normalized_timespec(&delta,
-                               xtime.tv_sec - oldtime,
-                               xtime.tv_nsec - (NSEC_PER_SEC >> 1));
+                               ts.tv_sec - oldtime,
+                               ts.tv_nsec - (NSEC_PER_SEC >> 1));
 
        return 0;
 }