diff options
author | Shaun Ruffell <sruffell@digium.com> | 2009-01-20 21:23:34 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2009-01-20 21:23:34 +0000 |
commit | 71ba0631e3f0d50c1b3e19c6282fe362a5d63ee7 (patch) | |
tree | b1a75b9a433edffbf6ea369055d6297e8e23fc21 /drivers | |
parent | afc0f6efe0840537b8e332c2fa3b93c9bbc18354 (diff) |
Some distributions have backported the hrtimer_get_expires and
hrtimer_set_expires functions from 2.6.28. Therefore, dahdi-linux cannot use
the linux version code to determine if these functions are present or not.
This patch actively checks for those functions.
Closes Issue: #14166
Thanks to bergolth for the patch.
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5770 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dahdi/Kbuild | 4 | ||||
-rw-r--r-- | drivers/dahdi/dahdi_dummy.c | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/drivers/dahdi/Kbuild b/drivers/dahdi/Kbuild index c5742b9..6e3f7a1 100644 --- a/drivers/dahdi/Kbuild +++ b/drivers/dahdi/Kbuild @@ -56,6 +56,10 @@ ifneq (,$(filter $(KVERS),$(BAD_KERNELS))) EXTRA_CFLAGS+=-Drw_lock_t=rwlock_t endif +ifeq (1,$(shell fgrep -q ' hrtimer_set_expires' include/linux/hrtimer.h 2>/dev/null && echo 1)) +EXTRA_CFLAGS+=-DHAVE_HRTIMER_ACCESSORS=1 +endif + dahdi-objs := dahdi-base.o dahdi_echocan_hpec-objs := hpec/dahdi_echocan_hpec.o diff --git a/drivers/dahdi/dahdi_dummy.c b/drivers/dahdi/dahdi_dummy.c index a3d12ac..a009ac2 100644 --- a/drivers/dahdi/dahdi_dummy.c +++ b/drivers/dahdi/dahdi_dummy.c @@ -89,8 +89,10 @@ #define USB2420 #endif -#if defined(USE_HIGHRESTIMER) && ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) ) -/* compatibility with new hrtimer interface */ +#if defined(USE_HIGHRESTIMER) && \ + (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27)) || \ + (!defined(HAVE_HRTIMER_ACCESSORS)) +/* Compatibility with new hrtimer interface */ static inline ktime_t hrtimer_get_expires(const struct hrtimer *timer) { return timer->expires; |