summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2009-05-01 16:42:45 +0000
committerShaun Ruffell <sruffell@digium.com>2009-05-01 16:42:45 +0000
commitc8a6832d4237a30bf121c9ddebce4e16b1f26884 (patch)
treef9426f566a78c86be7c464caa694f97dabd70306
parentbed6f2d95d74e8fac9d20ff2bc48fa204624eea5 (diff)
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
-rw-r--r--drivers/dahdi/wctc4xxp/base.c6
1 files changed, 6 insertions, 0 deletions
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;