From: David Schleef Date: Mon, 13 Aug 2001 10:29:19 +0000 (+0000) Subject: Eliminated test on LINUX_V2x in favor of LINUX_VERSION_CODE tests. X-Git-Tag: r0_7_61~176 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=41ef2f4c4b4f47c6fda6ae736359831d5fadb21f;p=comedi.git Eliminated test on LINUX_V2x in favor of LINUX_VERSION_CODE tests. --- diff --git a/comedi/comedi_fops.c b/comedi/comedi_fops.c index 3275a7a7..d8db350f 100644 --- a/comedi/comedi_fops.c +++ b/comedi/comedi_fops.c @@ -23,7 +23,6 @@ #undef DEBUG -#include #define __NO_VERSION__ #include @@ -35,15 +34,16 @@ #include #include #include -#include -#ifdef LINUX_V22 #include -#include -#endif -#if LINUX_VERSION_CODE >= 0x020100 #include -#endif -#include + +#include + +#include +#include + +#include "kvmem.h" + comedi_device *comedi_devices; @@ -1235,7 +1235,14 @@ static int do_cancel(comedi_device *dev,comedi_subdevice *s) return ret; } -#ifdef LINUX_V22 + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0) /* XXX */ +#define RDEV_OF_FILE(x) ((x)->f_inode->i_rdev) +#else +#define RDEV_OF_FILE(x) ((x)->f_dentry->d_inode->i_rdev) +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0) void comedi_unmap(struct vm_area_struct *area) { comedi_async *async; @@ -1280,7 +1287,11 @@ static int comedi_mmap_v22(struct file * file, struct vm_area_struct *vma) return -EINVAL; } - if(VM_OFFSET(vma) != 0){ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) + if(vma->vm_offset != 0){ +#else + if(vma->vm_pgoff != 0){ +#endif DPRINTK("comedi: mmap() offset must be 0.\n"); return -EINVAL; } @@ -1713,7 +1724,7 @@ static int comedi_fasync (int fd, struct file *file, int on) kernel compatibility */ -#ifdef LINUX_V20 +#if LINUX_VERSION_CODE < 0x020100 static int comedi_write_v20(struct inode *inode,struct file *file,const char *buf,int nbytes) { @@ -1749,7 +1760,7 @@ static struct file_operations comedi_fops={ #endif -#ifdef LINUX_V22 +#if LINUX_VERSION_CODE >= 0x020200 #define comedi_ioctl_v22 comedi_ioctl #define comedi_open_v22 comedi_fop_open diff --git a/comedi/comedi_ksyms.c b/comedi/comedi_ksyms.c index 885d447e..d1f81760 100644 --- a/comedi/comedi_ksyms.c +++ b/comedi/comedi_ksyms.c @@ -31,7 +31,7 @@ -#ifdef LINUX_V22 +#if LINUX_VERSION_CODE >= 0x020200 /* for drivers */ EXPORT_SYMBOL(comedi_driver_register); diff --git a/comedi/drivers.c b/comedi/drivers.c index 9dd1d609..d64f6402 100644 --- a/comedi/drivers.c +++ b/comedi/drivers.c @@ -21,12 +21,9 @@ */ -#include -#include #define __NO_VERSION__ #include - #include #include #include @@ -35,8 +32,12 @@ #include #include #include +#include + #include +#include "kvmem.h" + #ifdef CONFIG_COMEDI_TRIG /* in comedi/trig.c */ int command_trig(comedi_device *dev,comedi_subdevice *s,comedi_trig *it); diff --git a/comedi/range.c b/comedi/range.c index 4becd522..a5da9cb4 100644 --- a/comedi/range.c +++ b/comedi/range.c @@ -22,9 +22,7 @@ */ #include -#ifdef LINUX_V22 #include -#endif comedi_lrange range_bipolar10={ 1, {BIP_RANGE(10)}};