aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2013-01-11 07:42:00 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-01-11 10:30:27 -0500
commit68d6f84ba0c47e658beff3a4bf0c43acee4b4690 (patch)
treee7bc2338632362b70faf53d2ed9ee7cf8aae7bb8 /drivers/media
parent29005c09f41d459c458eb8761a54703b56afb16a (diff)
[media] uvcvideo: Set error_idx properly for S_EXT_CTRLS failures
The uvc_set_ctrl() calls don't write to the hardware. A failure at that point thus leaves the device in a clean state, with no control modified. Set the error_idx field to the count value to reflect that, as per the V4L2 specification. TRY_EXT_CTRLS is unchanged and the error_idx field must always be set to the failed control index in that case. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/usb/uvc/uvc_v4l2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
index 5eb89894f90b..68d59b527492 100644
--- a/drivers/media/usb/uvc/uvc_v4l2.c
+++ b/drivers/media/usb/uvc/uvc_v4l2.c
@@ -685,7 +685,8 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
685 ret = uvc_ctrl_set(chain, ctrl); 685 ret = uvc_ctrl_set(chain, ctrl);
686 if (ret < 0) { 686 if (ret < 0) {
687 uvc_ctrl_rollback(handle); 687 uvc_ctrl_rollback(handle);
688 ctrls->error_idx = i; 688 ctrls->error_idx = cmd == VIDIOC_S_EXT_CTRLS
689 ? ctrls->count : i;
689 return ret; 690 return ret;
690 } 691 }
691 } 692 }