1 Copyright (C) 2008 Stefan Lippers-Hollmann <s....@gmx.de>
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);
9 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
10 + struct quickcam *qc = (struct quickcam *)video_get_drvdata(dev);
12 struct quickcam *qc = (struct quickcam *)dev->priv;
14 struct qc_frame_data *fd = &qc->frame_data;
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);
21 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
22 + struct quickcam *qc = video_get_drvdata(dev);
24 struct quickcam *qc = dev->priv;
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);
33 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
34 + struct quickcam *qc = (struct quickcam *)video_get_drvdata(dev);
36 struct quickcam *qc = (struct quickcam *)dev->priv;
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;
45 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
46 + struct quickcam *qc = (struct quickcam *)video_get_drvdata(dev);
48 struct quickcam *qc = (struct quickcam *)dev->priv;
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;
57 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
58 + struct quickcam *qc = (struct quickcam *)video_get_drvdata(dev);
60 struct quickcam *qc = (struct quickcam *)dev->priv;
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;
69 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
70 + struct quickcam *qc = (struct quickcam *)video_get_drvdata(dev);
72 struct quickcam *qc = (struct quickcam *)dev->priv;
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);
86 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
87 qc->vdev.parent = &(qc->dev->dev);