aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-02-10 12:32:52 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-03-05 12:42:12 -0500
commitb27763f0faad374e215a474389ff5949e0b40764 (patch)
treed24a25141915e172ee725b1ce26e40765be5db19
parent89ea47069cc536f6ae6f428c89bcb960fea3eaff (diff)
[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>
-rw-r--r--drivers/media/usb/stkwebcam/stk-webcam.c12
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)
768static int stk_vidioc_querycap(struct file *filp, 768static int stk_vidioc_querycap(struct file *filp,
769 void *priv, struct v4l2_capability *cap) 769 void *priv, struct v4l2_capability *cap)
770{ 770{
771 struct stk_camera *dev = video_drvdata(filp);
772
771 strcpy(cap->driver, "stk"); 773 strcpy(cap->driver, "stk");
772 strcpy(cap->card, "stk"); 774 strcpy(cap->card, "stk");
773 cap->version = DRIVER_VERSION_NUM; 775 usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info));
774 776
775 cap->capabilities = V4L2_CAP_VIDEO_CAPTURE 777 cap->device_caps = V4L2_CAP_VIDEO_CAPTURE
776 | V4L2_CAP_READWRITE | V4L2_CAP_STREAMING; 778 | V4L2_CAP_READWRITE | V4L2_CAP_STREAMING;
779 cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
777 return 0; 780 return 0;
778} 781}
779 782
@@ -797,10 +800,7 @@ static int stk_vidioc_g_input(struct file *filp, void *priv, unsigned int *i)
797 800
798static int stk_vidioc_s_input(struct file *filp, void *priv, unsigned int i) 801static int stk_vidioc_s_input(struct file *filp, void *priv, unsigned int i)
799{ 802{
800 if (i != 0) 803 return i ? -EINVAL : 0;
801 return -EINVAL;
802 else
803 return 0;
804} 804}
805 805
806static int stk_s_ctrl(struct v4l2_ctrl *ctrl) 806static int stk_s_ctrl(struct v4l2_ctrl *ctrl)