The patch number 11263 was added via Trent Piepho <[email protected]>
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 <[email protected]>
------
From: Trent Piepho <[email protected]>
gspca: Stop setting buffer type, and avoid memset in querycap
The v4l2-ioctl core checks the buffer type now by only allowing buffer
types for which the corresponding ->vidioc_try_fmt_xxx() methods are
defined.
This driver only defines ->vidioc_try_fmt_vid_cap() so only VIDEO_CAPTURE
buffers are allowed to be used with vidioc_g_parm. Also,
->vidioc_enum_fmt_vid_cap() is only called for VIDEO_CAPTURE buffers.
There is no need to set the buffer type since it must already be the
correct value.
The struct which ->vidioc_querycap() is supposed to fill in is already
zeroed so it's not necessary to call memset on it.
Priority: normal
Signed-off-by: Trent Piepho <[email protected]>
CC: Jean-Francois Moine <[email protected]>
---
linux/drivers/media/video/gspca/gspca.c | 4 ----
1 file changed, 4 deletions(-)
diff -r 935d095cbc31 -r 089aaa41d473 linux/drivers/media/video/gspca/gspca.c
--- a/linux/drivers/media/video/gspca/gspca.c Sat Mar 28 18:25:35 2009 -0700
+++ b/linux/drivers/media/video/gspca/gspca.c Sat Mar 28 18:25:35 2009 -0700
@@ -777,7 +777,6 @@ static int vidioc_enum_fmt_vid_cap(struc
fmtdesc->pixelformat = fmt_tb[index];
if (gspca_is_compressed(fmt_tb[index]))
fmtdesc->flags = V4L2_FMT_FLAG_COMPRESSED;
- fmtdesc->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
fmtdesc->description[0] = fmtdesc->pixelformat & 0xff;
fmtdesc->description[1] = (fmtdesc->pixelformat >> 8) & 0xff;
fmtdesc->description[2] = (fmtdesc->pixelformat >> 16) & 0xff;
@@ -973,8 +972,6 @@ static int vidioc_querycap(struct file *
{
struct gspca_dev *gspca_dev = priv;
int ret;
-
- memset(cap, 0, sizeof *cap);
/* protect the access to the usb device */
if (mutex_lock_interruptible(&gspca_dev->usb_lock))
@@ -1353,7 +1350,6 @@ static int vidioc_g_parm(struct file *fi
{
struct gspca_dev *gspca_dev = priv;
- parm->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
parm->parm.capture.readbuffers = gspca_dev->nbufread;
if (gspca_dev->sd_desc->get_streamparm) {
---
Patch is available at:
http://linuxtv.org/hg/v4l-dvb/rev/089aaa41d47385dc5547c314b9a52f9f41a26f69
_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits