summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2009-01-20 10:33:57 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2009-01-20 10:33:57 +0000
commit2c24e607308ac56269be9d48e04bb4215fbe733b (patch)
treeb61e9c787c9ced97b17cd6fad6ee02ace5fa8e5c
parent2ef0f4d9c5963d1091d8505e247c4d1ccad67f25 (diff)
Adjust ztdummy to the new timers interface of kernel 2.6.28
(From DAHDI rev. 5211) git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@4617 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rw-r--r--kernel/ztdummy.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/kernel/ztdummy.c b/kernel/ztdummy.c
index e2f45da..fda7340 100644
--- a/kernel/ztdummy.c
+++ b/kernel/ztdummy.c
@@ -90,6 +90,18 @@
#endif
#include "ztdummy.h"
+#if defined(USE_HIGHRESTIMER) && ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) )
+/* compatibility with new hrtimer interface */
+static inline ktime_t hrtimer_get_expires(const struct hrtimer *timer)
+{
+ return timer->expires;
+}
+
+static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time)
+{
+ timer->expires = time;
+}
+#endif
static struct ztdummy *ztd;
@@ -199,7 +211,7 @@ static enum hrtimer_restart ztdummy_hr_int(struct hrtimer *htmr)
* expired.
* We should worry if overrun is 2 or more; then we really missed
* a tick */
- overrun = hrtimer_forward(&zaptimer, htmr->expires,
+ overrun = hrtimer_forward(&zaptimer, hrtimer_get_expires(htmr),
ktime_set(0, ZAPTEL_TIME_NS));
if(overrun > 1) {
if(printk_ratelimit())
@@ -222,7 +234,7 @@ static enum hrtimer_restart ztdummy_hr_int(struct hrtimer *htmr)
/* use kernel system tick timer if PC architecture RTC is not available */
static void ztdummy_timer(unsigned long param)
{
- timer.expires = jiffies + 1;
+ hrtimer_set_expires(timer, jiffies + 1);
add_timer(&timer);
ztd->counter += ZAPTEL_TIME;