diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2012-05-06 09:28:21 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-14 09:27:57 -0300 |
commit | cc7b6f257d42eb9829b38e3a8807943426a89a87 (patch) | |
tree | 1b19378610c8817b3103a77ccf1925ff4e4bc527 /drivers/media/video/gspca/gspca.c | |
parent | d57fb9f8a69deb521ffabac02d2fea484141e59c (diff) |
[media] gspca: Fix querycap and incorrect return codes
Add V4L2_CAP_DEVICE_CAPS support to querycap and replace -EINVAL by
-ENOTTY whenever an ioctl is not supported.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/gspca.c')
-rw-r--r-- | drivers/media/video/gspca/gspca.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index 9fe723c6acb4..7669f27238c3 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c @@ -1066,10 +1066,10 @@ static int vidioc_g_register(struct file *file, void *priv, struct gspca_dev *gspca_dev = video_drvdata(file); if (!gspca_dev->sd_desc->get_chip_ident) - return -EINVAL; + return -ENOTTY; if (!gspca_dev->sd_desc->get_register) - return -EINVAL; + return -ENOTTY; if (mutex_lock_interruptible(&gspca_dev->usb_lock)) return -ERESTARTSYS; @@ -1090,10 +1090,10 @@ static int vidioc_s_register(struct file *file, void *priv, struct gspca_dev *gspca_dev = video_drvdata(file); if (!gspca_dev->sd_desc->get_chip_ident) - return -EINVAL; + return -ENOTTY; if (!gspca_dev->sd_desc->set_register) - return -EINVAL; + return -ENOTTY; if (mutex_lock_interruptible(&gspca_dev->usb_lock)) return -ERESTARTSYS; @@ -1115,7 +1115,7 @@ static int vidioc_g_chip_ident(struct file *file, void *priv, struct gspca_dev *gspca_dev = video_drvdata(file); if (!gspca_dev->sd_desc->get_chip_ident) - return -EINVAL; + return -ENOTTY; if (mutex_lock_interruptible(&gspca_dev->usb_lock)) return -ERESTARTSYS; @@ -1410,9 +1410,10 @@ static int vidioc_querycap(struct file *file, void *priv, } usb_make_path(gspca_dev->dev, (char *) cap->bus_info, sizeof(cap->bus_info)); - cap->capabilities = V4L2_CAP_VIDEO_CAPTURE + cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING | V4L2_CAP_READWRITE; + cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; ret = 0; out: mutex_unlock(&gspca_dev->usb_lock); @@ -1565,7 +1566,7 @@ static int vidioc_querymenu(struct file *file, void *priv, struct gspca_dev *gspca_dev = video_drvdata(file); if (!gspca_dev->sd_desc->querymenu) - return -EINVAL; + return -ENOTTY; return gspca_dev->sd_desc->querymenu(gspca_dev, qmenu); } @@ -1774,7 +1775,7 @@ static int vidioc_g_jpegcomp(struct file *file, void *priv, int ret; if (!gspca_dev->sd_desc->get_jcomp) - return -EINVAL; + return -ENOTTY; if (mutex_lock_interruptible(&gspca_dev->usb_lock)) return -ERESTARTSYS; gspca_dev->usb_err = 0; @@ -1793,7 +1794,7 @@ static int vidioc_s_jpegcomp(struct file *file, void *priv, int ret; if (!gspca_dev->sd_desc->set_jcomp) - return -EINVAL; + return -ENOTTY; if (mutex_lock_interruptible(&gspca_dev->usb_lock)) return -ERESTARTSYS; gspca_dev->usb_err = 0; |