diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2013-02-10 14:32:52 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-03-05 14:42:12 -0300 |
commit | b27763f0faad374e215a474389ff5949e0b40764 (patch) | |
tree | d24a25141915e172ee725b1ce26e40765be5db19 /drivers/media/usb/stkwebcam | |
parent | 89ea47069cc536f6ae6f428c89bcb960fea3eaff (diff) | |
download | talos-obmc-linux-b27763f0faad374e215a474389ff5949e0b40764.tar.gz talos-obmc-linux-b27763f0faad374e215a474389ff5949e0b40764.zip |
[media] stk-webcam: fix querycap and simplify s_input
Add device_caps support to querycap, fill in bus_info correctly and
do not set the version field (let the core handle that).
Also simplify the s_input ioctl.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb/stkwebcam')
-rw-r--r-- | drivers/media/usb/stkwebcam/stk-webcam.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/media/usb/stkwebcam/stk-webcam.c b/drivers/media/usb/stkwebcam/stk-webcam.c index c07366619227..a00edf3de6bd 100644 --- a/drivers/media/usb/stkwebcam/stk-webcam.c +++ b/drivers/media/usb/stkwebcam/stk-webcam.c @@ -768,12 +768,15 @@ static int v4l_stk_mmap(struct file *fp, struct vm_area_struct *vma) static int stk_vidioc_querycap(struct file *filp, void *priv, struct v4l2_capability *cap) { + struct stk_camera *dev = video_drvdata(filp); + strcpy(cap->driver, "stk"); strcpy(cap->card, "stk"); - cap->version = DRIVER_VERSION_NUM; + usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info)); - cap->capabilities = V4L2_CAP_VIDEO_CAPTURE + cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE | V4L2_CAP_STREAMING; + cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; return 0; } @@ -797,10 +800,7 @@ static int stk_vidioc_g_input(struct file *filp, void *priv, unsigned int *i) static int stk_vidioc_s_input(struct file *filp, void *priv, unsigned int i) { - if (i != 0) - return -EINVAL; - else - return 0; + return i ? -EINVAL : 0; } static int stk_s_ctrl(struct v4l2_ctrl *ctrl) |