The patch number 10795 was added via Mauro Carvalho Chehab <mche...@redhat.com>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        Linux Media Mailing List <linux-me...@vger.kernel.org>

------

From: Mauro Carvalho Chehab  <mche...@redhat.com>
merge: http://linuxtv.org/hg/~tap/v4l-dvb


Signed-off-by: Mauro Carvalho Chehab <mche...@redhat.com>


---

 linux/drivers/media/dvb/b2c2/flexcop-pci.c            |    4 ----
 linux/drivers/media/dvb/dvb-usb/dvb-usb.h             |    4 ----
 linux/drivers/media/radio/radio-si470x.c              |    4 ----
 linux/drivers/media/video/cx88/cx88.h                 |    1 -
 linux/drivers/media/video/em28xx/em28xx.h             |    4 ----
 linux/drivers/media/video/meye.c                      |    4 ----
 linux/drivers/media/video/stk-webcam.c                |    8 +-------
 linux/drivers/media/video/usbvision/usbvision-video.c |    3 ---
 linux/drivers/media/video/v4l2-dev.c                  |    7 +++----
 linux/drivers/media/video/v4l2-ioctl.c                |    5 +++++
 linux/drivers/media/video/zoran/zoran_driver.c        |    7 +------
 v4l/compat.h                                          |    8 ++++++++
 12 files changed, 18 insertions(+), 41 deletions(-)

diff -r 1b20206ceca3 -r ca7e5497e099 linux/drivers/media/dvb/b2c2/flexcop-pci.c
--- a/linux/drivers/media/dvb/b2c2/flexcop-pci.c        Tue Mar 03 21:32:23 
2009 -0300
+++ b/linux/drivers/media/dvb/b2c2/flexcop-pci.c        Tue Mar 03 21:34:27 
2009 -0300
@@ -67,11 +67,7 @@ struct flexcop_pci {
 
        unsigned long last_irq;
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
-       struct work_struct irq_check_work;
-#else
        struct delayed_work irq_check_work;
-#endif
 
        struct flexcop_device *fc_dev;
 };
diff -r 1b20206ceca3 -r ca7e5497e099 linux/drivers/media/dvb/dvb-usb/dvb-usb.h
--- a/linux/drivers/media/dvb/dvb-usb/dvb-usb.h Tue Mar 03 21:32:23 2009 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb.h Tue Mar 03 21:34:27 2009 -0300
@@ -364,11 +364,7 @@ struct dvb_usb_device {
        /* remote control */
        struct input_dev *rc_input_dev;
        char rc_phys[64];
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
-       struct work_struct rc_query_work;
-#else
        struct delayed_work rc_query_work;
-#endif
        u32 last_event;
        int last_state;
 
diff -r 1b20206ceca3 -r ca7e5497e099 linux/drivers/media/radio/radio-si470x.c
--- a/linux/drivers/media/radio/radio-si470x.c  Tue Mar 03 21:32:23 2009 -0300
+++ b/linux/drivers/media/radio/radio-si470x.c  Tue Mar 03 21:34:27 2009 -0300
@@ -459,11 +459,7 @@ struct si470x_device {
        unsigned short registers[RADIO_REGISTER_NUM];
 
        /* RDS receive buffer */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
-       struct work_struct work;
-#else
        struct delayed_work work;
-#endif
        wait_queue_head_t read_queue;
        struct mutex lock;              /* buffer locking */
        unsigned char *buffer;          /* size is always multiple of three */
diff -r 1b20206ceca3 -r ca7e5497e099 linux/drivers/media/video/cx88/cx88.h
--- a/linux/drivers/media/video/cx88/cx88.h     Tue Mar 03 21:32:23 2009 -0300
+++ b/linux/drivers/media/video/cx88/cx88.h     Tue Mar 03 21:34:27 2009 -0300
@@ -306,7 +306,6 @@ struct cx88_dmaqueue {
        struct btcx_riscmem    stopper;
        u32                    count;
 };
-struct cx88_core;
 
 struct cx88_core {
        struct list_head           devlist;
diff -r 1b20206ceca3 -r ca7e5497e099 linux/drivers/media/video/em28xx/em28xx.h
--- a/linux/drivers/media/video/em28xx/em28xx.h Tue Mar 03 21:32:23 2009 -0300
+++ b/linux/drivers/media/video/em28xx/em28xx.h Tue Mar 03 21:34:27 2009 -0300
@@ -571,11 +571,7 @@ struct em28xx {
        /* Snapshot button */
        char snapshot_button_path[30];  /* path of the input dev */
        struct input_dev *sbutton_input_dev;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
-       struct work_struct sbutton_query_work;
-#else
        struct delayed_work sbutton_query_work;
-#endif
 
        struct em28xx_dvb *dvb;
 };
diff -r 1b20206ceca3 -r ca7e5497e099 linux/drivers/media/video/meye.c
--- a/linux/drivers/media/video/meye.c  Tue Mar 03 21:32:23 2009 -0300
+++ b/linux/drivers/media/video/meye.c  Tue Mar 03 21:34:27 2009 -0300
@@ -1451,10 +1451,6 @@ static int vidioc_querybuf(struct file *
        if (index < 0 || index >= gbuffers)
                return -EINVAL;
 
-       memset(buf, 0, sizeof(*buf));
-
-       buf->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-       buf->index = index;
        buf->bytesused = meye.grab_buffer[index].size;
        buf->flags = V4L2_BUF_FLAG_MAPPED;
 
diff -r 1b20206ceca3 -r ca7e5497e099 linux/drivers/media/video/stk-webcam.c
--- a/linux/drivers/media/video/stk-webcam.c    Tue Mar 03 21:32:23 2009 -0300
+++ b/linux/drivers/media/video/stk-webcam.c    Tue Mar 03 21:34:27 2009 -0300
@@ -1140,16 +1140,10 @@ static int stk_vidioc_querybuf(struct fi
 static int stk_vidioc_querybuf(struct file *filp,
                void *priv, struct v4l2_buffer *buf)
 {
-       int index;
        struct stk_camera *dev = priv;
        struct stk_sio_buffer *sbuf;
 
-       if (buf->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
-               return -EINVAL;
-
-       index = buf->index;
-
-       if (index < 0 || index >= dev->n_sbufs)
+       if (buf->index < 0 || buf->index >= dev->n_sbufs)
                return -EINVAL;
        sbuf = dev->sio_bufs + buf->index;
        *buf = sbuf->v4lbuf;
diff -r 1b20206ceca3 -r ca7e5497e099 
linux/drivers/media/video/usbvision/usbvision-video.c
--- a/linux/drivers/media/video/usbvision/usbvision-video.c     Tue Mar 03 
21:32:23 2009 -0300
+++ b/linux/drivers/media/video/usbvision/usbvision-video.c     Tue Mar 03 
21:34:27 2009 -0300
@@ -788,9 +788,6 @@ static int vidioc_querybuf (struct file 
 
        /* FIXME : must control
           that buffers are mapped (VIDIOC_REQBUFS has been called) */
-       if(vb->type != V4L2_CAP_VIDEO_CAPTURE) {
-               return -EINVAL;
-       }
        if(vb->index>=usbvision->num_frames)  {
                return -EINVAL;
        }
diff -r 1b20206ceca3 -r ca7e5497e099 linux/drivers/media/video/v4l2-dev.c
--- a/linux/drivers/media/video/v4l2-dev.c      Tue Mar 03 21:32:23 2009 -0300
+++ b/linux/drivers/media/video/v4l2-dev.c      Tue Mar 03 21:34:27 2009 -0300
@@ -404,12 +404,11 @@ int video_register_device_index(struct v
 
        /* A minor value of -1 marks this video device as never
           having been registered */
-       if (vdev)
-               vdev->minor = -1;
+       vdev->minor = -1;
 
        /* the release callback MUST be present */
-       WARN_ON(!vdev || !vdev->release);
-       if (!vdev || !vdev->release)
+       WARN_ON(!vdev->release);
+       if (!vdev->release)
                return -EINVAL;
 
        /* Part 1: check device type */
diff -r 1b20206ceca3 -r ca7e5497e099 linux/drivers/media/video/v4l2-ioctl.c
--- a/linux/drivers/media/video/v4l2-ioctl.c    Tue Mar 03 21:32:23 2009 -0300
+++ b/linux/drivers/media/video/v4l2-ioctl.c    Tue Mar 03 21:34:27 2009 -0300
@@ -970,6 +970,11 @@ static long __video_do_ioctl(struct file
                if (ret)
                        break;
 
+               /* Zero out all fields starting with bytesysed, which is
+                * everything but index and type.  */
+               memset(0, &p->bytesused,
+                      sizeof(*p) - offsetof(typeof(*p), bytesused));
+
                ret = ops->vidioc_querybuf(file, fh, p);
                if (!ret)
                        dbgbuf(cmd, vfd, p);
diff -r 1b20206ceca3 -r ca7e5497e099 
linux/drivers/media/video/zoran/zoran_driver.c
--- a/linux/drivers/media/video/zoran/zoran_driver.c    Tue Mar 03 21:32:23 
2009 -0300
+++ b/linux/drivers/media/video/zoran/zoran_driver.c    Tue Mar 03 21:34:27 
2009 -0300
@@ -2499,12 +2499,7 @@ static int zoran_querybuf(struct file *f
 {
        struct zoran_fh *fh = __fh;
        struct zoran *zr = fh->zr;
-       __u32 type = buf->type;
-       int index = buf->index, res;
-
-       memset(buf, 0, sizeof(*buf));
-       buf->type = type;
-       buf->index = index;
+       int res;
 
        mutex_lock(&zr->resource_lock);
        res = zoran_v4l2_buffer_status(file, buf, buf->index);
diff -r 1b20206ceca3 -r ca7e5497e099 v4l/compat.h
--- a/v4l/compat.h      Tue Mar 03 21:32:23 2009 -0300
+++ b/v4l/compat.h      Tue Mar 03 21:34:27 2009 -0300
@@ -4,6 +4,14 @@
 
 #ifndef _COMPAT_H
 #define _COMPAT_H
+
+/* In v2.6.19-rc6-118-g52bad64 struct work_struct was was changed to be only 
for
+ * non-delayed work and struct delayed_work was created for delayed work.  This
+ * will rename the structures.  Hopefully no one will decide to name something
+ * delayed_work in the same context as something named work_struct.  */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
+#define delayed_work work_struct
+#endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
 #define        KERN_CONT       ""


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/ca7e5497e0996c3e2b72a3ba878f7fa8dba73c2e

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to