From c8a6832d4237a30bf121c9ddebce4e16b1f26884 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Fri, 1 May 2009 16:42:45 +0000 Subject: wctc4xxp: spin_trylock_irqsave is not defined on some kernels. DAHDI-253 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6551 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/wctc4xxp/base.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/dahdi/wctc4xxp/base.c b/drivers/dahdi/wctc4xxp/base.c index aea02d6..3942251 100644 --- a/drivers/dahdi/wctc4xxp/base.c +++ b/drivers/dahdi/wctc4xxp/base.c @@ -2049,8 +2049,14 @@ wctc4xxp_handle_receive_ring(struct wcdte *wc) /* If we can't grab this lock, another thread must already be checking * the receive ring...so we should just finish up, and we'll try again * later. */ +#if defined(spin_trylock_irqsave) if (!spin_trylock_irqsave(&wc->rx_lock, flags)) return 0; +#else + if (spin_is_locked(&wc->rx_lock)) + return 0; + spin_lock_irqsave(&wc->rx_lock, flags); +#endif while ((cmd = wctc4xxp_retrieve(wc->rxd))) { ++count; -- cgit v1.2.3