diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2008-11-03 12:01:01 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2008-11-03 12:01:01 +0000 |
commit | 0ed6f1087f319294cc031bf99eb49d73320842a4 (patch) | |
tree | aaf64735a7d14004873138c427c2cb773235c26b /drivers | |
parent | 114a9bb0cdd330d3e1508ee6f0b6207ae906a281 (diff) |
Adjust DAHDI to the new timers interface of kernel 2.6.28
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5211 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dahdi/dahdi_dummy.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/dahdi/dahdi_dummy.c b/drivers/dahdi/dahdi_dummy.c index 532dbe3..42a617f 100644 --- a/drivers/dahdi/dahdi_dummy.c +++ b/drivers/dahdi/dahdi_dummy.c @@ -89,6 +89,19 @@ #define USB2420 #endif +#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 + struct dahdi_dummy { struct dahdi_span span; struct dahdi_chan _chan; @@ -184,7 +197,7 @@ static enum hrtimer_restart dahdi_dummy_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, DAHDI_TIME_NS)); if(overrun > 1) { if(printk_ratelimit()) @@ -207,7 +220,7 @@ static enum hrtimer_restart dahdi_dummy_hr_int(struct hrtimer *htmr) /* use kernel system tick timer if PC architecture RTC is not available */ static void dahdi_dummy_timer(unsigned long param) { - timer.expires = jiffies + 1; + hrtimer_set_expires(timer, jiffies + 1); add_timer(&timer); ztd->counter += DAHDI_TIME; |