diff options
Diffstat (limited to 'drivers/rtc/class.c')
-rw-r--r-- | drivers/rtc/class.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index 8b3cd31d6a61..10ab3b71ffc6 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c | |||
@@ -46,6 +46,7 @@ static int rtc_suspend(struct device *dev, pm_message_t mesg) | |||
46 | { | 46 | { |
47 | struct rtc_device *rtc = to_rtc_device(dev); | 47 | struct rtc_device *rtc = to_rtc_device(dev); |
48 | struct rtc_time tm; | 48 | struct rtc_time tm; |
49 | struct timespec ts = current_kernel_time(); | ||
49 | 50 | ||
50 | if (strncmp(rtc->dev.bus_id, | 51 | if (strncmp(rtc->dev.bus_id, |
51 | CONFIG_RTC_HCTOSYS_DEVICE, | 52 | CONFIG_RTC_HCTOSYS_DEVICE, |
@@ -57,8 +58,8 @@ static int rtc_suspend(struct device *dev, pm_message_t mesg) | |||
57 | 58 | ||
58 | /* RTC precision is 1 second; adjust delta for avg 1/2 sec err */ | 59 | /* RTC precision is 1 second; adjust delta for avg 1/2 sec err */ |
59 | set_normalized_timespec(&delta, | 60 | set_normalized_timespec(&delta, |
60 | xtime.tv_sec - oldtime, | 61 | ts.tv_sec - oldtime, |
61 | xtime.tv_nsec - (NSEC_PER_SEC >> 1)); | 62 | ts.tv_nsec - (NSEC_PER_SEC >> 1)); |
62 | 63 | ||
63 | return 0; | 64 | return 0; |
64 | } | 65 | } |