Merge branch 'drm-forlinus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
[pandora-kernel.git] / arch / arm / kernel / time.c
index 1b7fcd5..d7d932c 100644 (file)
 #include <linux/sysdev.h>
 #include <linux/timer.h>
 
-#include <asm/hardware.h>
-#include <asm/io.h>
-#include <asm/irq.h>
 #include <asm/leds.h>
 #include <asm/thread_info.h>
 #include <asm/mach/time.h>
 
-u64 jiffies_64 = INITIAL_JIFFIES;
-
-EXPORT_SYMBOL(jiffies_64);
-
 /*
  * Our system timer.
  */
@@ -102,7 +95,7 @@ static unsigned long next_rtc_update;
  */
 static inline void do_set_rtc(void)
 {
-       if (time_status & STA_UNSYNC || set_rtc == NULL)
+       if (!ntp_synced() || set_rtc == NULL)
                return;
 
        if (next_rtc_update &&
@@ -292,10 +285,7 @@ int do_settimeofday(struct timespec *tv)
        set_normalized_timespec(&xtime, sec, nsec);
        set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec);
 
-       time_adjust = 0;                /* stop active adjtime() */
-       time_status |= STA_UNSYNC;
-       time_maxerror = NTP_PHASE_LIMIT;
-       time_esterror = NTP_PHASE_LIMIT;
+       ntp_clear();
        write_sequnlock_irq(&xtime_lock);
        clock_was_set();
        return 0;
@@ -433,10 +423,12 @@ void timer_dyn_reprogram(void)
 {
        struct dyn_tick_timer *dyn_tick = system_timer->dyn_tick;
 
-       write_seqlock(&xtime_lock);
-       if (dyn_tick->state & DYN_TICK_ENABLED)
-               dyn_tick->reprogram(next_timer_interrupt() - jiffies);
-       write_sequnlock(&xtime_lock);
+       if (dyn_tick) {
+               write_seqlock(&xtime_lock);
+               if (dyn_tick->state & DYN_TICK_ENABLED)
+                       dyn_tick->reprogram(next_timer_interrupt() - jiffies);
+               write_sequnlock(&xtime_lock);
+       }
 }
 
 static ssize_t timer_show_dyn_tick(struct sys_device *dev, char *buf)