diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-02-01 08:51:53 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-02-02 09:28:15 -0500 |
commit | e5e542eea9075dd008993c2ee80b2cc9f31fc494 (patch) | |
tree | 5e63edaec5a5e0ce34b479ccc70fa311610d2abc /drivers/char | |
parent | 4359ac0ace1a2a267927390ad27f781a2f8e0ab8 (diff) |
posix-timers: Convert clock_getres() to clockid_to_kclock()
Use the new kclock decoding. Fixup the fallout in mmtimer.c
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: John Stultz <johnstul@us.ibm.com>
Tested-by: Richard Cochran <richard.cochran@omicron.at>
LKML-Reference: <20110201134418.709802797@linutronix.de>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/mmtimer.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/char/mmtimer.c b/drivers/char/mmtimer.c index 262d10453cb8..141ffaeb976c 100644 --- a/drivers/char/mmtimer.c +++ b/drivers/char/mmtimer.c | |||
@@ -53,6 +53,8 @@ MODULE_LICENSE("GPL"); | |||
53 | 53 | ||
54 | #define RTC_BITS 55 /* 55 bits for this implementation */ | 54 | #define RTC_BITS 55 /* 55 bits for this implementation */ |
55 | 55 | ||
56 | static struct k_clock sgi_clock; | ||
57 | |||
56 | extern unsigned long sn_rtc_cycles_per_second; | 58 | extern unsigned long sn_rtc_cycles_per_second; |
57 | 59 | ||
58 | #define RTC_COUNTER_ADDR ((long *)LOCAL_MMR_ADDR(SH_RTC)) | 60 | #define RTC_COUNTER_ADDR ((long *)LOCAL_MMR_ADDR(SH_RTC)) |
@@ -763,10 +765,18 @@ static int sgi_timer_set(struct k_itimer *timr, int flags, | |||
763 | return err; | 765 | return err; |
764 | } | 766 | } |
765 | 767 | ||
768 | static int sgi_clock_getres(const clockid_t which_clock, struct timespec *tp) | ||
769 | { | ||
770 | tp->tv_sec = 0; | ||
771 | tp->tv_nsec = sgi_clock.res; | ||
772 | return 0; | ||
773 | } | ||
774 | |||
766 | static struct k_clock sgi_clock = { | 775 | static struct k_clock sgi_clock = { |
767 | .res = 0, | 776 | .res = 0, |
768 | .clock_set = sgi_clock_set, | 777 | .clock_set = sgi_clock_set, |
769 | .clock_get = sgi_clock_get, | 778 | .clock_get = sgi_clock_get, |
779 | .clock_getres = sgi_clock_getres, | ||
770 | .timer_create = sgi_timer_create, | 780 | .timer_create = sgi_timer_create, |
771 | .timer_set = sgi_timer_set, | 781 | .timer_set = sgi_timer_set, |
772 | .timer_del = sgi_timer_del, | 782 | .timer_del = sgi_timer_del, |