Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: remove old RTC support

All RTC drivers have been converted to rtclib, so the old code
providing the set_rtc function pointer, save_time_delta() and
restore_time_delta() functions is obsolete. Remove it.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

-82
-8
arch/arm/include/asm/mach/time.h
··· 46 46 extern struct sys_timer *system_timer; 47 47 extern void timer_tick(void); 48 48 49 - /* 50 - * Kernel time keeping support. 51 - */ 52 - struct timespec; 53 - extern int (*set_rtc)(void); 54 - extern void save_time_delta(struct timespec *delta, struct timespec *rtc); 55 - extern void restore_time_delta(struct timespec *delta, struct timespec *rtc); 56 - 57 49 #endif
-74
arch/arm/kernel/time.c
··· 10 10 * 11 11 * This file contains the ARM-specific time handling details: 12 12 * reading the RTC at bootup, etc... 13 - * 14 - * 1994-07-02 Alan Modra 15 - * fixed set_rtc_mmss, fixed time.year for >= 2000, new mktime 16 - * 1998-12-20 Updated NTP code according to technical memorandum Jan '96 17 - * "A Kernel Model for Precision Timekeeping" by Dave Mills 18 13 */ 19 14 #include <linux/module.h> 20 15 #include <linux/kernel.h> ··· 72 77 EXPORT_SYMBOL(profile_pc); 73 78 #endif 74 79 75 - /* 76 - * hook for setting the RTC's idea of the current time. 77 - */ 78 - int (*set_rtc)(void); 79 - 80 80 #ifndef CONFIG_GENERIC_TIME 81 81 static unsigned long dummy_gettimeoffset(void) 82 82 { 83 83 return 0; 84 84 } 85 85 #endif 86 - 87 - static unsigned long next_rtc_update; 88 - 89 - /* 90 - * If we have an externally synchronized linux clock, then update 91 - * CMOS clock accordingly every ~11 minutes. set_rtc() has to be 92 - * called as close as possible to 500 ms before the new second 93 - * starts. 94 - */ 95 - static inline void do_set_rtc(void) 96 - { 97 - if (!ntp_synced() || set_rtc == NULL) 98 - return; 99 - 100 - if (next_rtc_update && 101 - time_before((unsigned long)xtime.tv_sec, next_rtc_update)) 102 - return; 103 - 104 - if (xtime.tv_nsec < 500000000 - ((unsigned) tick_nsec >> 1) && 105 - xtime.tv_nsec >= 500000000 + ((unsigned) tick_nsec >> 1)) 106 - return; 107 - 108 - if (set_rtc()) 109 - /* 110 - * rtc update failed. Try again in 60s 111 - */ 112 - next_rtc_update = xtime.tv_sec + 60; 113 - else 114 - next_rtc_update = xtime.tv_sec + 660; 115 - } 116 86 117 87 #ifdef CONFIG_LEDS 118 88 ··· 255 295 EXPORT_SYMBOL(do_settimeofday); 256 296 #endif /* !CONFIG_GENERIC_TIME */ 257 297 258 - /** 259 - * save_time_delta - Save the offset between system time and RTC time 260 - * @delta: pointer to timespec to store delta 261 - * @rtc: pointer to timespec for current RTC time 262 - * 263 - * Return a delta between the system time and the RTC time, such 264 - * that system time can be restored later with restore_time_delta() 265 - */ 266 - void save_time_delta(struct timespec *delta, struct timespec *rtc) 267 - { 268 - set_normalized_timespec(delta, 269 - xtime.tv_sec - rtc->tv_sec, 270 - xtime.tv_nsec - rtc->tv_nsec); 271 - } 272 - EXPORT_SYMBOL(save_time_delta); 273 - 274 - /** 275 - * restore_time_delta - Restore the current system time 276 - * @delta: delta returned by save_time_delta() 277 - * @rtc: pointer to timespec for current RTC time 278 - */ 279 - void restore_time_delta(struct timespec *delta, struct timespec *rtc) 280 - { 281 - struct timespec ts; 282 - 283 - set_normalized_timespec(&ts, 284 - delta->tv_sec + rtc->tv_sec, 285 - delta->tv_nsec + rtc->tv_nsec); 286 - 287 - do_settimeofday(&ts); 288 - } 289 - EXPORT_SYMBOL(restore_time_delta); 290 - 291 298 #ifndef CONFIG_GENERIC_CLOCKEVENTS 292 299 /* 293 300 * Kernel system timer support. ··· 263 336 { 264 337 profile_tick(CPU_PROFILING); 265 338 do_leds(); 266 - do_set_rtc(); 267 339 write_seqlock(&xtime_lock); 268 340 do_timer(1); 269 341 write_sequnlock(&xtime_lock);