diff options
-rw-r--r-- | drivers/dahdi/Kbuild | 4 | ||||
-rw-r--r-- | include/dahdi/kernel.h | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/dahdi/Kbuild b/drivers/dahdi/Kbuild index f0af285..3fe2e28 100644 --- a/drivers/dahdi/Kbuild +++ b/drivers/dahdi/Kbuild @@ -64,6 +64,10 @@ ifeq (1,$(shell fgrep -q ' hrtimer_set_expires' include/linux/hrtimer.h 2>/dev/n EXTRA_CFLAGS+=-DHAVE_HRTIMER_ACCESSORS=1 endif +ifeq (1,$(shell fgrep -q 'wait_for_completion_timeout' include/linux/completion.h 2>/dev/null && echo 1)) +CFLAGS_MODULE+=-DHAVE_WAIT_FOR_COMPLETION_TIMEOUT=1 +endif + # In 2.6.18 skb_linearize changed; however, some distros backported the change ifneq (,$(wildcard $(srctree)/include/linux/skbuff.h)) ifeq ($(shell grep "skb_linearize.*(.*, .* gfp)" $(srctree)/include/linux/skbuff.h),) diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h index 22fc3ee..ef71459 100644 --- a/include/dahdi/kernel.h +++ b/include/dahdi/kernel.h @@ -1209,6 +1209,7 @@ static inline void list_replace(struct list_head *old, struct list_head *new) #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12) #define synchronize_rcu() synchronize_kernel() #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 11) +#if !defined(HAVE_WAIT_FOR_COMPLETION_TIMEOUT) static inline unsigned long wait_for_completion_timeout(struct completion *x, unsigned long timeout) { @@ -1221,6 +1222,7 @@ wait_for_completion_timeout(struct completion *x, unsigned long timeout) return timeout; } +#endif #endif /* 2.6.11 */ #endif /* 2.6.12 */ #endif /* 2.6.14 */ |