updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / qc-usb / qc-usb-0.6.6-kcompat-2.6.28.patch
blob5e73da210693639b10456d63838a0943be2fbef9
1 Copyright (C) 2008 Stefan Lippers-Hollmann <s....@gmx.de>
3 --- a/qc-driver.c
4 +++ b/qc-driver.c
5 @@ -2255,7 +2255,11 @@ static unsigned int qc_v4l_poll(struct v
6 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
7 struct video_device *dev = video_devdata(file);
8 #endif
9 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
10 + struct quickcam *qc = (struct quickcam *)video_get_drvdata(dev);
11 +#else
12 struct quickcam *qc = (struct quickcam *)dev->priv;
13 +#endif
14 struct qc_frame_data *fd = &qc->frame_data;
15 int mask;
17 @@ -2307,7 +2311,11 @@ static int qc_v4l_open(struct video_devi
18 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
19 struct video_device *dev = video_devdata(file);
20 #endif
21 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
22 + struct quickcam *qc = video_get_drvdata(dev);
23 +#else
24 struct quickcam *qc = dev->priv;
25 +#endif
26 int r;
28 if (qcdebug&QC_DEBUGLOGIC || qcdebug&QC_DEBUGUSER) PDEBUG("qc_v4l_open(qc=%p)", qc);
29 @@ -2375,7 +2383,11 @@ static void qc_v4l_close(struct video_de
30 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
31 struct video_device *dev = video_devdata(file);
32 #endif
33 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
34 + struct quickcam *qc = (struct quickcam *)video_get_drvdata(dev);
35 +#else
36 struct quickcam *qc = (struct quickcam *)dev->priv;
37 +#endif
38 if (qcdebug&QC_DEBUGLOGIC || qcdebug&QC_DEBUGUSER) PDEBUG("qc_v4l_close(dev=%p,qc=%p)",dev,qc);
39 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
40 TEST_BUGR_MSG(qc==NULL, "qc==NULL");
41 @@ -2423,7 +2435,11 @@ static long qc_v4l_read(struct video_dev
42 struct video_device *dev = video_devdata(file);
43 int noblock = file->f_flags & O_NONBLOCK;
44 #endif
45 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
46 + struct quickcam *qc = (struct quickcam *)video_get_drvdata(dev);
47 +#else
48 struct quickcam *qc = (struct quickcam *)dev->priv;
49 +#endif
50 int frame_len;
51 unsigned char *frame;
52 long r = 0;
53 @@ -2478,7 +2494,11 @@ static int qc_v4l_mmap(
54 const void *start = (void *)vma->vm_start;
55 unsigned long size = vma->vm_end - vma->vm_start;
56 #endif
57 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
58 + struct quickcam *qc = (struct quickcam *)video_get_drvdata(dev);
59 +#else
60 struct quickcam *qc = (struct quickcam *)dev->priv;
61 +#endif
62 unsigned char *frame;
63 int ret = 0, frame_size;
64 #if !HAVE_VMA && LINUX_VERSION_CODE<KERNEL_VERSION(2,6,0)
65 @@ -2510,7 +2530,11 @@ static int qc_v4l_ioctl(struct video_dev
66 struct video_device *dev = video_devdata(file);
67 void *argp = (void *)arg;
68 #endif
69 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
70 + struct quickcam *qc = (struct quickcam *)video_get_drvdata(dev);
71 +#else
72 struct quickcam *qc = (struct quickcam *)dev->priv;
73 +#endif
74 int i, retval = 0;
76 if (qcdebug&QC_DEBUGLOGIC || qcdebug&QC_DEBUGUSER) PDEBUG("qc_v4l_ioctl(dev=%p,cmd=%u,arg=%p,qc=%p)",dev,cmd,argp,qc);
77 @@ -3165,7 +3189,11 @@ PDEBUG("poisoning qc in qc_usb_init");
79 /* Register V4L video device */
80 memcpy(&qc->vdev, &qc_v4l_template, sizeof(qc_v4l_template));
81 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
82 + video_set_drvdata(&qc->vdev, qc);
83 +#else
84 qc->vdev.priv = qc;
85 +#endif
86 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
87 qc->vdev.parent = &(qc->dev->dev);
88 #else