mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 21:51:05 +00:00
Cleanup non-arch xtime uses, use get_seconds() or current_kernel_time().
This avoids use of the kernel-internal "xtime" variable directly outside of the actual time-related functions. Instead, use the helper functions that we already have available to us. This doesn't actually change any behaviour, but this will allow us to fix the fact that "xtime" isn't updated very often with CONFIG_NO_HZ (because much of the realtime information is maintained as separate offsets to 'xtime'), which has caused interfaces that use xtime directly to get a time that is out of sync with the real-time clock by up to a third of a second or so. Signed-off-by: John Stultz <johnstul@us.ibm.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
0de085bb47
commit
2c6b47de17
13 changed files with 34 additions and 33 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue