diff -Naur ov51x-jpeg-1.5.9.orig/ov511-decomp.c ov51x-jpeg-1.5.9/ov511-decomp.c --- ov51x-jpeg-1.5.9.orig/ov511-decomp.c 2008-09-28 12:58:09.000000000 +0200 +++ ov51x-jpeg-1.5.9/ov511-decomp.c 2011-06-25 14:40:22.180000231 +0200 @@ -22,7 +22,7 @@ * Free Software Foundation; version 2 of the License. */ -#include +#include #include #include "ov51x-jpeg.h" @@ -508,6 +508,5 @@ struct ov51x_decomp_ops ov511_decomp_ops = { .decomp_400 = Decompress400, .decomp_420 = Decompress420, - .owner = THIS_MODULE, }; diff -Naur ov51x-jpeg-1.5.9.orig/ov518-decomp.c ov51x-jpeg-1.5.9/ov518-decomp.c --- ov51x-jpeg-1.5.9.orig/ov518-decomp.c 2008-09-28 12:58:09.000000000 +0200 +++ ov51x-jpeg-1.5.9/ov518-decomp.c 2011-06-25 14:40:22.180000231 +0200 @@ -25,7 +25,7 @@ * Free Software Foundation; version 2 of the License. */ -#include +#include #include #include "ov51x-jpeg.h" @@ -1488,6 +1488,5 @@ struct ov51x_decomp_ops ov518_decomp_ops = { .decomp_400 = Decompress400, .decomp_420 = Decompress420, - .owner = THIS_MODULE, }; diff -Naur ov51x-jpeg-1.5.9.orig/ov519-decomp.c ov51x-jpeg-1.5.9/ov519-decomp.c --- ov51x-jpeg-1.5.9.orig/ov519-decomp.c 2008-09-28 12:58:09.000000000 +0200 +++ ov51x-jpeg-1.5.9/ov519-decomp.c 2011-06-25 14:40:22.180000231 +0200 @@ -24,7 +24,7 @@ * See: http://zc0302.sourceforge.net/zc0302.php */ -#include +#include #include #include "ov51x-jpeg.h" @@ -1534,7 +1534,6 @@ struct ov51x_decomp_ops ov519_decomp_ops = { .decomp_400 = Decompress400, .decomp_420 = Decompress420, - .owner = THIS_MODULE, }; diff -Naur ov51x-jpeg-1.5.9.orig/ov51x-jpeg-core.c ov51x-jpeg-1.5.9/ov51x-jpeg-core.c --- ov51x-jpeg-1.5.9.orig/ov51x-jpeg-core.c 2008-09-28 12:58:09.000000000 +0200 +++ ov51x-jpeg-1.5.9/ov51x-jpeg-core.c 2011-06-25 14:40:48.720000244 +0200 @@ -12,6 +12,9 @@ * To support OV7670 sensors as found in Creative Live! Vista IM webcam * With reference to One Laptop Per Child sourced kernel patches in 2.6.20 kernel * contributed to kernel by Jonathan Corbet. +* +* Modified to work with 2.6.29 kernels by Onur Küçük +* */ @@ -84,7 +87,7 @@ * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include +#include #define OV51x_JPEG_VERSION "1.5.9" @@ -534,13 +537,13 @@ static int sensor_get_picture(struct usb_ov511 *, struct video_picture *); static int sensor_get_exposure(struct usb_ov511 *, unsigned char *); static int ov51x_check_snapshot(struct usb_ov511 *); -static int ov51x_control_ioctl(struct inode *, struct file *, unsigned int, +static long ov51x_control_ioctl(struct inode *, struct file *, unsigned int, unsigned long); static struct file_operations ov511_control_fops = { - .ioctl = ov51x_control_ioctl, + .unlocked_ioctl = ov51x_control_ioctl, #ifdef CONFIG_COMPAT - .compat_ioctl = v4l_compat_ioctl32, + .compat_ioctl = v4l2_compat_ioctl32, #endif }; @@ -678,7 +681,6 @@ ov->proc_devdir = create_proc_entry(dirname, S_IFDIR, ov51x_jpeg_proc_entry); if (!ov->proc_devdir) return; - ov->proc_devdir->owner = THIS_MODULE; /* Create "info" entry (human readable device information) */ PDEBUG(4, "creating /proc/ov51x-jpeg/ov51x/%s/info", dirname); @@ -686,7 +688,6 @@ ov->proc_devdir, ov511_read_proc_info, ov); if (!ov->proc_info) return; - ov->proc_info->owner = THIS_MODULE; /* Don't create it if old snapshot mode on (would cause race cond.) */ if (!snapshot) { @@ -697,7 +698,6 @@ ov511_read_proc_button, ov); if (!ov->proc_button) return; - ov->proc_button->owner = THIS_MODULE; } /* Create "control" entry (ioctl() interface) */ @@ -709,7 +709,6 @@ unlock_kernel(); return; } - ov->proc_control->owner = THIS_MODULE; ov->proc_control->data = ov; ov->proc_control->proc_fops = &ov511_control_fops; unlock_kernel(); @@ -762,9 +761,7 @@ */ ov51x_jpeg_proc_entry = create_proc_entry("ov51x-jpeg", S_IFDIR, &proc_root); - if (ov51x_jpeg_proc_entry) - ov51x_jpeg_proc_entry->owner = THIS_MODULE; - else + if (!ov51x_jpeg_proc_entry) err("Unable to create /proc/ov51x-jpeg"); } @@ -5733,7 +5730,7 @@ { #else static int -ov51x_v4l1_open(struct inode *inode, struct file *file) +ov51x_v4l1_open(struct file *file) { struct video_device *vdev = video_devdata(file); #endif @@ -5804,7 +5801,7 @@ { #else static int -ov51x_v4l1_close(struct inode *inode, struct file *file) +ov51x_v4l1_close(struct file *file) { struct video_device *vdev = file->private_data; #endif @@ -5850,13 +5847,14 @@ } /* Do not call this function directly! */ -static int #ifdef OV511_OLD_V4L +static long ov51x_v4l1_ioctl_internal(struct usb_ov511 *ov, unsigned int cmd, void *arg) { #else -ov51x_v4l1_ioctl_internal(struct inode *inode, struct file *file, +static long +ov51x_v4l1_ioctl_internal(struct file *file, unsigned int cmd, void *arg) { struct video_device *vdev = file->private_data; @@ -6355,7 +6353,7 @@ return err; } -static int +static long ov51x_v4l1_ioctl(struct video_device *vdev, unsigned int cmd, void *arg) { struct usb_ov511 *ov = vdev->priv; @@ -6372,8 +6370,8 @@ #else /* If new V4L API */ -static int -ov51x_v4l1_ioctl(struct inode *inode, struct file *file, +static long +ov51x_v4l1_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { struct video_device *vdev = file->private_data; @@ -6383,7 +6381,7 @@ if (down_interruptible(&ov->lock)) return -EINTR; - rc = video_usercopy(inode, file, cmd, arg, ov51x_v4l1_ioctl_internal); + rc = video_usercopy(file, cmd, arg, ov51x_v4l1_ioctl_internal); up(&ov->lock); return rc; @@ -6609,7 +6607,6 @@ #ifdef OV511_OLD_V4L static struct video_device vdev_template = { - .owner = THIS_MODULE, .name = "OV511 USB Camera", .type = VID_TYPE_CAPTURE, #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) @@ -6624,22 +6621,19 @@ #else /* New V4L API */ -static struct file_operations ov511_fops = { - .owner = THIS_MODULE, +static struct v4l2_file_operations ov511_fops = { .open = ov51x_v4l1_open, .release = ov51x_v4l1_close, .read = ov51x_v4l1_read, .mmap = ov51x_v4l1_mmap, .ioctl = ov51x_v4l1_ioctl, -#ifdef CONFIG_COMPAT - .compat_ioctl = v4l_compat_ioctl32, -#endif - .llseek = no_llseek, +/*#ifdef CONFIG_COMPAT + .compat_ioctl = v4l2_compat_ioctl32, +#endif*/ }; static struct video_device vdev_template = { #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) - .owner = THIS_MODULE, #endif .name = "OV51x USB Camera", #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) @@ -6654,7 +6648,7 @@ }; #endif /* OV511_OLD_V4L */ -static int +static long ov51x_control_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long ularg) { @@ -8304,11 +8298,11 @@ init_waitqueue_head(&ov->wq); - init_MUTEX(&ov->lock); /* to 1 == available */ - init_MUTEX(&ov->buf_lock); - init_MUTEX(&ov->param_lock); - init_MUTEX(&ov->i2c_lock); - init_MUTEX(&ov->cbuf_lock); + sema_init(&ov->lock,1); /* to 1 == available */ + sema_init(&ov->buf_lock,1); + sema_init(&ov->param_lock,1); + sema_init(&ov->i2c_lock,1); + sema_init(&ov->cbuf_lock,1); ov->buf_state = BUF_NOT_ALLOCATED; @@ -8374,7 +8368,7 @@ memcpy(ov->vdev, &vdev_template, sizeof(*ov->vdev)); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) - ov->vdev->dev = dev->dev; + ov->vdev->parent = &dev->dev; #else ov->vdev->dev = &dev->dev; #endif diff -Naur ov51x-jpeg-1.5.9.orig/ov51x-jpeg.h ov51x-jpeg-1.5.9/ov51x-jpeg.h --- ov51x-jpeg-1.5.9.orig/ov51x-jpeg.h 2008-09-28 12:58:09.000000000 +0200 +++ ov51x-jpeg-1.5.9/ov51x-jpeg.h 2011-06-25 14:40:15.801000231 +0200 @@ -63,6 +63,12 @@ #include #endif +/* Add missing info and warn macros by hand for new kernels */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28) +#define info(args...) printk(KERN_INFO KBUILD_MODNAME args) +#define warn(args...) printk(KERN_WARNING KBUILD_MODNAME args) +#endif + /* --------------------------------- */ /* DEFINES FOR OV511 AND OTHER CHIPS */ /* --------------------------------- */ @@ -582,7 +588,6 @@ int, int, int); int (*decomp_422)(unsigned char *, unsigned char *, unsigned char *, int, int, int); - struct module *owner; }; extern struct ov51x_decomp_ops ov511_decomp_ops;