1 by Stefan Lippers-Hollmann <s.l-h@gmx.de>
2 fixes kernel 2.6.24 compatibility.
4 diff -urNad qc-usb-0.6.6~/qc-driver.c qc-usb-0.6.6/qc-driver.c
5 --- qc-usb-0.6.6~/qc-driver.c 2006-10-24 04:06:19.000000000 +0200
6 +++ qc-usb-0.6.6/qc-driver.c 2007-12-09 17:20:30.000000000 +0100
9 urb->transfer_buffer = kmalloc(qc_i2c_maxbufsize*sizeof(u8), GFP_KERNEL); /* Allocate maximum ever needed */
10 if (!urb->transfer_buffer) goto fail3;
11 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
12 spin_lock_init(&urb->lock);
14 urb->complete = qc_i2c_handler;
16 #if (LINUX_VERSION_CODE<KERNEL_VERSION(2,6,9) && !defined(CONFIG_SUSE_KERNEL)) || LINUX_VERSION_CODE<KERNEL_VERSION(2,6,8)
18 static struct video_device qc_v4l_template = {
20 type: VID_TYPE_CAPTURE | VID_TYPE_SUBCAPTURE,
21 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
22 hardware: VID_HARDWARE_QCAM_USB,
25 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
26 release: qc_v4l_release,
27 diff -urNad qc-usb-0.6.6~/quickcam.h qc-usb-0.6.6/quickcam.h
28 --- qc-usb-0.6.6~/quickcam.h 2006-11-04 14:38:27.000000000 +0100
29 +++ qc-usb-0.6.6/quickcam.h 2007-12-09 17:17:01.000000000 +0100
33 typedef unsigned char Bool;
34 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
35 #define BIT(x) (1<<(x))
37 #define SIZE(a) (sizeof(a)/sizeof((a)[0]))
38 #define MAX(a,b) ((a)>(b)?(a):(b))
39 #define MIN(a,b) ((a)<(b)?(a):(b))
40 --- a/qc-driver.c.ori 2008-04-18 13:44:38.000000000 +0200
41 +++ b/qc-driver.c 2008-04-18 13:44:46.000000000 +0200
43 /* Register V4L video device */
44 memcpy(&qc->vdev, &qc_v4l_template, sizeof(qc_v4l_template));
46 + qc->vdev.dev = &(qc->dev->dev);
47 r = video_register_device(&qc->vdev, VFL_TYPE_GRABBER, video_nr);
49 PRINTK(KERN_INFO, "Registered device: /dev/video%i", qc->vdev.minor);