diff -Naur a/video_device.c b/video_device.c --- a/video_device.c 2008-11-09 16:54:51.000000000 +0100 +++ b/video_device.c 2010-01-12 15:15:52.000000000 +0100 @@ -111,8 +111,12 @@ /************************************************ **************** V4L FUNCTIONS *************** ************************************************/ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) static int v4l_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { - +#else +static int v4l_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { +#endif + switch(cmd) { /* Get capabilities */ case VIDIOCGCAP: @@ -374,8 +378,12 @@ } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) static int v4l_open(struct inode *inode, struct file *file) { - +#else +static int v4l_open(struct file *file) { +#endif + #ifdef DEBUG printk(KERNEL_PREFIX "entering v4l_open()\n"); #endif @@ -386,8 +394,13 @@ return 0; } + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) static int v4l_close(struct inode *inode, struct file *file) { - +#else +static int v4l_close(struct file *file) { +#endif + #ifdef DEBUG printk(KERNEL_PREFIX "entering v4l_close()\n"); #endif @@ -397,9 +410,6 @@ return 0; } - - - static int v4l_mmap(struct file *file, struct vm_area_struct *vma) { struct page *page = NULL; @@ -616,7 +626,11 @@ //kfree(vdev); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) static struct file_operations v4l_fops = { +#else +static struct v4l2_file_operations v4l_fops = { +#endif owner: THIS_MODULE, open: v4l_open, release: v4l_close, @@ -624,8 +638,10 @@ mmap: v4l_mmap, write: v4l_write, ioctl: v4l_ioctl, +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) compat_ioctl: v4l_compat_ioctl32, llseek: no_llseek, +#endif }; static struct video_device my_device = { name: "Dummy video device",