[PATCH 067/342] Staging: comedi: Work around malformed RTAI_VERSION_CODE.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ian Abbott <abbotti at mev.co.uk>

Signed-off-by: Frank Mori Hess <fmhess at users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>
---
 drivers/staging/comedi/drivers/comedi_rt_timer.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/comedi/drivers/comedi_rt_timer.c b/drivers/staging/comedi/drivers/comedi_rt_timer.c
index 8dbd0fd..5d79c54 100644
--- a/drivers/staging/comedi/drivers/comedi_rt_timer.c
+++ b/drivers/staging/comedi/drivers/comedi_rt_timer.c
@@ -108,6 +108,21 @@ static inline RTIME nano2count(long long ns)
 #ifdef CONFIG_COMEDI_RTAI
 #include <rtai.h>
 #include <rtai_sched.h>
+#include <rtai_version.h>
+
+/* RTAI_VERSION_CODE doesn't work for rtai-3.6-cv and other strange versions.
+ * These are characterized by CONFIG_RTAI_REVISION_LEVEL being defined as an
+ * empty macro and CONFIG_RTAI_VERSION_MINOR being defined as something like
+ * '6-cv' or '7-test1'.  The problem has been noted by the RTAI folks and they
+ * promise not to do it again. :-) Try and work around it here. */
+#if !(CONFIG_RTAI_REVISION_LEVEL + 0)
+#undef CONFIG_RTAI_REVISION_LEVEL
+#define CONFIG_RTAI_REVISION_LEVEL	0
+#define cv	0
+#define test1	0
+#define test2	0
+#define test3	0
+#endif
 
 #if RTAI_VERSION_CODE < RTAI_MANGLE_VERSION(3,3,0)
 #define comedi_rt_task_context_t	int
@@ -115,6 +130,12 @@ static inline RTIME nano2count(long long ns)
 #define comedi_rt_task_context_t	long
 #endif
 
+/* Finished checking RTAI_VERSION_CODE. */
+#undef cv
+#undef test1
+#undef test2
+#undef test3
+
 #endif
 
 /* This defines the fastest speed we will emulate.  Note that
-- 
1.6.3.2



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux