[dahdi-commits] tzafrir: linux/trunk r5211 - /linux/trunk/drivers/dahdi/dahdi_dummy.c

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Mon Nov 3 06:01:03 CST 2008


Author: tzafrir
Date: Mon Nov  3 06:01:01 2008
New Revision: 5211

URL: http://svn.digium.com/view/dahdi?view=rev&rev=5211
Log:
Adjust DAHDI to the new timers interface of kernel 2.6.28

Modified:
    linux/trunk/drivers/dahdi/dahdi_dummy.c

Modified: linux/trunk/drivers/dahdi/dahdi_dummy.c
URL: http://svn.digium.com/view/dahdi/linux/trunk/drivers/dahdi/dahdi_dummy.c?view=diff&rev=5211&r1=5210&r2=5211
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi_dummy.c (original)
+++ linux/trunk/drivers/dahdi/dahdi_dummy.c Mon Nov  3 06:01:01 2008
@@ -87,6 +87,19 @@
 #include <linux/version.h>
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,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 {
@@ -184,7 +197,7 @@
 	 * 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 @@
 /* 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;




More information about the dahdi-commits mailing list