wcte43x: Build against 2.6.18 and CentOS 5.5
authorShaun Ruffell <sruffell@digium.com>
Wed, 30 Apr 2014 18:32:58 +0000 (13:32 -0500)
committerShaun Ruffell <sruffell@digium.com>
Wed, 30 Apr 2014 18:58:07 +0000 (13:58 -0500)
This is to support users who are unable to update to the lastest CentOS 5.x.
There is no change for most users on the latest releases of their distribution.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

drivers/dahdi/wcte43x-base.c

index b6aad3a..efc8617 100644 (file)
 #include "wcxb_spi.h"
 #include "wcxb_flash.h"
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
+#  ifdef RHEL_RELEASE_VERSION
+#    if RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(5, 6)
+#      define T43X_HAVE_CANCEL_WORK_SYNC
+#    endif
+#  else
+static inline int delayed_work_pending(struct work_struct *work)
+{
+       return test_bit(0, &work->pending);
+}
+#  endif
+#endif
+
 static const char *TE435_FW_FILENAME = "dahdi-fw-te435.bin";
 static const u32 TE435_VERSION = 0xe0019;
 
@@ -3477,7 +3490,12 @@ static void __devexit t43x_remove_one(struct pci_dev *pdev)
        wc->vpm = NULL;
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
+#  ifdef T43X_HAVE_CANCEL_WORK_SYNC 
        cancel_work_sync(&wc->clksrc_work.work);
+#  else
+       cancel_delayed_work(&wc->clksrc_work.work);
+       flush_workqueue(wc->wq);
+#  endif
 #else
        cancel_delayed_work_sync(&wc->clksrc_work.work);
 #endif