Mercurial > vloopback
changeset 14:647e63ddab46
Apply patch with some fix from Peter Holik to allow compile and work with kernel 2.6.29
author | AngelCarpintero |
---|---|
date | Wed, 08 Jul 2009 10:07:31 +0000 |
parents | 5971a90f2459 |
children | 1011e450be45 |
files | Makefile vloopback.c |
diffstat | 2 files changed, 29 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/Makefile Tue Jan 20 12:23:52 2009 +0000 +++ b/Makefile Wed Jul 08 10:07:31 2009 +0000 @@ -48,7 +48,7 @@ -/sbin/depmod -a clean: rm -f .*.cmd *.o *.mod.c *.ko .v* *~ core Modules.symvers Module.symvers modules.order - rm -rf .tmp_versions/ + rm -rf .tmp_versions/ Module.markers rm -f example/dummy example/feed example/resize example/invert dist: clean
--- a/vloopback.c Tue Jan 20 12:23:52 2009 +0000 +++ b/vloopback.c Wed Jul 08 10:07:31 2009 +0000 @@ -151,11 +151,15 @@ * in Makefile. * * 22.12.08 (Angel Carpintero) - * Allow build with kernel 2.6.28 and 2.6.27.git ( struct video_dev has not priv member anymore). + * Allow build with kernel 2.6.28 and 2.6.27.git ( struct video_dev has not priv member anymore). + * + * 17.05.09 (Peter Holik) + * Patch to allow work with kernel 2.6.29 + * */ -#define VLOOPBACK_VERSION "1.2-trunk" +#define VLOOPBACK_VERSION "1.3-trunk" /* Include files common to 2.4 and 2.6 versions */ #include <linux/version.h> /* >= 2.6.14 LINUX_VERSION_CODE */ @@ -164,6 +168,10 @@ #include <linux/module.h> #include <linux/pagemap.h> +#ifndef CONFIG_VIDEO_V4L1_COMPAT +#error "need CONFIG_VIDEO_V4L1_COMPAT" +#endif + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18) #include <media/v4l2-common.h> #endif @@ -376,7 +384,11 @@ return 0; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) static int vloopback_open(struct inode *inod, struct file *f) +#else +static int vloopback_open(struct file *f) +#endif { struct video_device *loopdev = video_devdata(f); priv_ptr ptr = (priv_ptr)loopdev->vd_private_data; @@ -430,7 +442,11 @@ return 0; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) static int vloopback_release(struct inode * inod, struct file *f) +#else +static int vloopback_release(struct file *f) +#endif { struct video_device *loopdev = video_devdata(f); priv_ptr ptr = (priv_ptr)loopdev->vd_private_data; @@ -691,8 +707,12 @@ return 0; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) static int vloopback_ioctl(struct inode *inod, struct file *f, unsigned int cmd, unsigned long arg) +#else +static long vloopback_ioctl(struct file *f, unsigned int cmd, unsigned long arg) +#endif { struct video_device *loopdev = video_devdata(f); priv_ptr ptr = (priv_ptr)loopdev->vd_private_data; @@ -1115,7 +1135,11 @@ return 0; } -static struct file_operations fileops_template = +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) +static const struct file_operations fileops_template = +#else +static const struct v4l2_file_operations fileops_template = +#endif { owner: THIS_MODULE, open: vloopback_open, @@ -1124,7 +1148,7 @@ write: vloopback_write, poll: vloopback_poll, ioctl: vloopback_ioctl, -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) compat_ioctl: v4l_compat_ioctl32, #endif mmap: vloopback_mmap, @@ -1157,7 +1181,6 @@ minor_in = 2 * nr + dev_offset; minor_out = 2 * nr + 1 + dev_offset; } - /* allocate space for this pipe */ loops[nr]= kmalloc(sizeof(struct vloopback_pipe), GFP_KERNEL);