diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2012-09-07 05:16:03 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-01-04 21:52:36 -0500 |
commit | 86ff7f1d4be99080d740fd88495154717cd39e2b (patch) | |
tree | 465c8fdedf0565a81a91af0205a7ae70274564a3 /drivers/media/usb/em28xx/em28xx-video.c | |
parent | 50fdf40f696106e0e3c9fa0ee2f6f1457209e81e (diff) |
[media] em28xx: fill in readbuffers and fix incorrect return code
g/s_parm should fill in readbuffers.
For non-webcams s_parm should return -ENOTTY instead of -EINVAL.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb/em28xx/em28xx-video.c')
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-video.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index acdb4340399f..a91a2484bc98 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c | |||
@@ -972,6 +972,7 @@ static int vidioc_g_parm(struct file *file, void *priv, | |||
972 | if (p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) | 972 | if (p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) |
973 | return -EINVAL; | 973 | return -EINVAL; |
974 | 974 | ||
975 | p->parm.capture.readbuffers = EM28XX_MIN_BUF; | ||
975 | if (dev->board.is_webcam) | 976 | if (dev->board.is_webcam) |
976 | rc = v4l2_device_call_until_err(&dev->v4l2_dev, 0, | 977 | rc = v4l2_device_call_until_err(&dev->v4l2_dev, 0, |
977 | video, g_parm, p); | 978 | video, g_parm, p); |
@@ -989,11 +990,12 @@ static int vidioc_s_parm(struct file *file, void *priv, | |||
989 | struct em28xx *dev = fh->dev; | 990 | struct em28xx *dev = fh->dev; |
990 | 991 | ||
991 | if (!dev->board.is_webcam) | 992 | if (!dev->board.is_webcam) |
992 | return -EINVAL; | 993 | return -ENOTTY; |
993 | 994 | ||
994 | if (p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) | 995 | if (p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) |
995 | return -EINVAL; | 996 | return -EINVAL; |
996 | 997 | ||
998 | p->parm.capture.readbuffers = EM28XX_MIN_BUF; | ||
997 | return v4l2_device_call_until_err(&dev->v4l2_dev, 0, video, s_parm, p); | 999 | return v4l2_device_call_until_err(&dev->v4l2_dev, 0, video, s_parm, p); |
998 | } | 1000 | } |
999 | 1001 | ||