updated on Thu Jan 12 04:00:44 UTC 2012
[aur-mirror.git] / qc-usb / qc-usb-0.6.6-kcompat-2.6.24.patch
blobdf546b7293a987d74883cead1bebdebe96d59e58
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
7 @@ -821,7 +821,9 @@
8 if (!cr) goto fail2;
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);
13 +#endif
14 urb->complete = qc_i2c_handler;
15 urb->context = qc;
16 #if (LINUX_VERSION_CODE<KERNEL_VERSION(2,6,9) && !defined(CONFIG_SUSE_KERNEL)) || LINUX_VERSION_CODE<KERNEL_VERSION(2,6,8)
17 @@ -3006,7 +3008,9 @@
18 static struct video_device qc_v4l_template = {
19 name: "QuickCam USB",
20 type: VID_TYPE_CAPTURE | VID_TYPE_SUBCAPTURE,
21 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
22 hardware: VID_HARDWARE_QCAM_USB,
23 +#endif
24 minor: -1,
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
30 @@ -126,7 +126,9 @@
31 #define FALSE 0
32 #define TRUE (!FALSE)
33 typedef unsigned char Bool;
34 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
35 #define BIT(x) (1<<(x))
36 +#endif
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
42 @@ -3160,6 +3160,7 @@
43 /* Register V4L video device */
44 memcpy(&qc->vdev, &qc_v4l_template, sizeof(qc_v4l_template));
45 qc->vdev.priv = qc;
46 + qc->vdev.dev = &(qc->dev->dev);
47 r = video_register_device(&qc->vdev, VFL_TYPE_GRABBER, video_nr);
48 if (r<0) goto fail3;
49 PRINTK(KERN_INFO, "Registered device: /dev/video%i", qc->vdev.minor);