From 865ab6d8c61677d60fa1bf94be553833b3ab023b Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Sat, 6 Dec 2003 19:34:33 +0000 Subject: [PATCH] fix for changes in linux 2.6 kdev_t.h --- comedi/comedi_fops.c | 18 +++++++++--------- comedi/drivers.c | 2 +- include/linux/kdev_t.h | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/comedi/comedi_fops.c b/comedi/comedi_fops.c index eab9bb9a..21a8b878 100644 --- a/comedi/comedi_fops.c +++ b/comedi/comedi_fops.c @@ -88,7 +88,7 @@ static void init_async_buf( comedi_async *async ); static int comedi_ioctl(struct inode * inode,struct file * file, unsigned int cmd,unsigned long arg) { - unsigned int minor=minor(inode->i_rdev); + unsigned int minor=MINOR(inode->i_rdev); comedi_device *dev=comedi_get_device_by_minor(minor); /* Device config is special, because it must work on @@ -1252,7 +1252,7 @@ static struct vm_operations_struct comedi_vm_ops={ static int comedi_mmap_v22(struct file * file, struct vm_area_struct *vma) { - unsigned int minor=minor(RDEV_OF_FILE(file)); + unsigned int minor=MINOR(RDEV_OF_FILE(file)); comedi_device *dev=comedi_get_device_by_minor(minor); comedi_async *async = NULL; unsigned long start = vma->vm_start; @@ -1324,7 +1324,7 @@ static unsigned int comedi_poll_v22(struct file *file, poll_table * wait) comedi_async *async; unsigned int mask; - dev=comedi_get_device_by_minor(minor(RDEV_OF_FILE(file))); + dev=comedi_get_device_by_minor(MINOR(RDEV_OF_FILE(file))); if(!dev->attached) { @@ -1366,7 +1366,7 @@ static ssize_t comedi_write_v22(struct file *file,const char *buf,size_t nbytes, int n,m,count=0,retval=0; DECLARE_WAITQUEUE(wait,current); - dev=comedi_get_device_by_minor(minor(RDEV_OF_FILE(file))); + dev=comedi_get_device_by_minor(MINOR(RDEV_OF_FILE(file))); if(!dev->attached) { @@ -1452,7 +1452,7 @@ static ssize_t comedi_read_v22(struct file * file,char *buf,size_t nbytes,loff_t int n,m,count=0,retval=0; DECLARE_WAITQUEUE(wait,current); - dev=comedi_get_device_by_minor(minor(RDEV_OF_FILE(file))); + dev=comedi_get_device_by_minor(MINOR(RDEV_OF_FILE(file))); if(!dev->attached) { @@ -1571,7 +1571,7 @@ static loff_t comedi_lseek_v22(struct file *file,loff_t offset,int origin) comedi_device *dev; loff_t new_offset; - dev=comedi_get_device_by_minor(minor(RDEV_OF_FILE(file))); + dev=comedi_get_device_by_minor(MINOR(RDEV_OF_FILE(file))); switch(origin){ case SEEK_SET: @@ -1594,7 +1594,7 @@ static loff_t comedi_lseek_v22(struct file *file,loff_t offset,int origin) static int comedi_fop_open(struct inode *inode,struct file *file) { - unsigned int minor=minor(inode->i_rdev); + unsigned int minor=MINOR(inode->i_rdev); comedi_device *dev; char mod[32]; @@ -1658,7 +1658,7 @@ ok: static int comedi_close_v22(struct inode *inode,struct file *file) { - comedi_device *dev=comedi_get_device_by_minor(minor(inode->i_rdev)); + comedi_device *dev=comedi_get_device_by_minor(MINOR(inode->i_rdev)); comedi_subdevice *s = NULL; int i; @@ -1696,7 +1696,7 @@ static int comedi_close_v22(struct inode *inode,struct file *file) #if LINUX_VERSION_CODE >= 0x020100 static int comedi_fasync (int fd, struct file *file, int on) { - comedi_device *dev=comedi_get_device_by_minor(minor(RDEV_OF_FILE(file))); + comedi_device *dev=comedi_get_device_by_minor(MINOR(RDEV_OF_FILE(file))); return fasync_helper(fd,file,on,&dev->async_queue); } diff --git a/comedi/drivers.c b/comedi/drivers.c index 4a016aa8..1c64a7c1 100644 --- a/comedi/drivers.c +++ b/comedi/drivers.c @@ -50,7 +50,7 @@ int comedi_buf_alloc(comedi_device *dev, comedi_subdevice *s, comedi_driver *comedi_drivers; -int comedi_modprobe(kdev_t minor) +int comedi_modprobe(int minor) { return -EINVAL; } diff --git a/include/linux/kdev_t.h b/include/linux/kdev_t.h index 86e0c163..3513fa8b 100644 --- a/include/linux/kdev_t.h +++ b/include/linux/kdev_t.h @@ -22,7 +22,7 @@ #include #include_next -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +#if 0 #ifndef major #define major(x) MAJOR(x) -- 2.26.2