]> Pileus Git - ~andy/linux/blobdiff - drivers/char/mmtimer.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
[~andy/linux] / drivers / char / mmtimer.c
index 262d10453cb858436b7586dd5e595f39eb49a3ea..33dc2298af73a9118649208df8e75a79bef1bd15 100644 (file)
@@ -53,6 +53,8 @@ MODULE_LICENSE("GPL");
 
 #define RTC_BITS 55 /* 55 bits for this implementation */
 
+static struct k_clock sgi_clock;
+
 extern unsigned long sn_rtc_cycles_per_second;
 
 #define RTC_COUNTER_ADDR        ((long *)LOCAL_MMR_ADDR(SH_RTC))
@@ -763,10 +765,17 @@ static int sgi_timer_set(struct k_itimer *timr, int flags,
        return err;
 }
 
+static int sgi_clock_getres(const clockid_t which_clock, struct timespec *tp)
+{
+       tp->tv_sec = 0;
+       tp->tv_nsec = sgi_clock_period;
+       return 0;
+}
+
 static struct k_clock sgi_clock = {
-       .res = 0,
        .clock_set      = sgi_clock_set,
        .clock_get      = sgi_clock_get,
+       .clock_getres   = sgi_clock_getres,
        .timer_create   = sgi_timer_create,
        .timer_set      = sgi_timer_set,
        .timer_del      = sgi_timer_del,
@@ -830,8 +839,8 @@ static int __init mmtimer_init(void)
                        (unsigned long) node);
        }
 
-       sgi_clock_period = sgi_clock.res = NSEC_PER_SEC / sn_rtc_cycles_per_second;
-       register_posix_clock(CLOCK_SGI_CYCLE, &sgi_clock);
+       sgi_clock_period = NSEC_PER_SEC / sn_rtc_cycles_per_second;
+       posix_timers_register_clock(CLOCK_SGI_CYCLE, &sgi_clock);
 
        printk(KERN_INFO "%s: v%s, %ld MHz\n", MMTIMER_DESC, MMTIMER_VERSION,
               sn_rtc_cycles_per_second/(unsigned long)1E6);