aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/uvc/uvc_v4l2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/usb/uvc/uvc_v4l2.c')
-rw-r--r--drivers/media/usb/uvc/uvc_v4l2.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
index 8e056046bc20..f2ee8c6b0d8d 100644
--- a/drivers/media/usb/uvc/uvc_v4l2.c
+++ b/drivers/media/usb/uvc/uvc_v4l2.c
@@ -607,10 +607,8 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
607 607
608 ret = uvc_ctrl_get(chain, &xctrl); 608 ret = uvc_ctrl_get(chain, &xctrl);
609 uvc_ctrl_rollback(handle); 609 uvc_ctrl_rollback(handle);
610 if (ret < 0) 610 if (ret >= 0)
611 return ret == -ENOENT ? -EINVAL : ret; 611 ctrl->value = xctrl.value;
612
613 ctrl->value = xctrl.value;
614 break; 612 break;
615 } 613 }
616 614
@@ -634,7 +632,7 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
634 ret = uvc_ctrl_set(chain, &xctrl); 632 ret = uvc_ctrl_set(chain, &xctrl);
635 if (ret < 0) { 633 if (ret < 0) {
636 uvc_ctrl_rollback(handle); 634 uvc_ctrl_rollback(handle);
637 return ret == -ENOENT ? -EINVAL : ret; 635 return ret;
638 } 636 }
639 ret = uvc_ctrl_commit(handle, &xctrl, 1); 637 ret = uvc_ctrl_commit(handle, &xctrl, 1);
640 if (ret == 0) 638 if (ret == 0)
@@ -661,7 +659,7 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
661 uvc_ctrl_rollback(handle); 659 uvc_ctrl_rollback(handle);
662 ctrls->error_idx = ret == -ENOENT 660 ctrls->error_idx = ret == -ENOENT
663 ? ctrls->count : i; 661 ? ctrls->count : i;
664 return ret == -ENOENT ? -EINVAL : ret; 662 return ret;
665 } 663 }
666 } 664 }
667 ctrls->error_idx = 0; 665 ctrls->error_idx = 0;
@@ -691,7 +689,7 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
691 ctrls->error_idx = (ret == -ENOENT && 689 ctrls->error_idx = (ret == -ENOENT &&
692 cmd == VIDIOC_S_EXT_CTRLS) 690 cmd == VIDIOC_S_EXT_CTRLS)
693 ? ctrls->count : i; 691 ? ctrls->count : i;
694 return ret == -ENOENT ? -EINVAL : ret; 692 return ret;
695 } 693 }
696 } 694 }
697 695