diff options
Diffstat (limited to 'drivers/media/usb/uvc/uvc_v4l2.c')
-rw-r--r-- | drivers/media/usb/uvc/uvc_v4l2.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c index 8e056046bc20..68d59b527492 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) |
@@ -659,9 +657,8 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) | |||
659 | ret = uvc_ctrl_get(chain, ctrl); | 657 | ret = uvc_ctrl_get(chain, ctrl); |
660 | if (ret < 0) { | 658 | if (ret < 0) { |
661 | uvc_ctrl_rollback(handle); | 659 | uvc_ctrl_rollback(handle); |
662 | ctrls->error_idx = ret == -ENOENT | 660 | ctrls->error_idx = i; |
663 | ? ctrls->count : i; | 661 | return ret; |
664 | return ret == -ENOENT ? -EINVAL : ret; | ||
665 | } | 662 | } |
666 | } | 663 | } |
667 | ctrls->error_idx = 0; | 664 | ctrls->error_idx = 0; |
@@ -688,10 +685,9 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) | |||
688 | ret = uvc_ctrl_set(chain, ctrl); | 685 | ret = uvc_ctrl_set(chain, ctrl); |
689 | if (ret < 0) { | 686 | if (ret < 0) { |
690 | uvc_ctrl_rollback(handle); | 687 | uvc_ctrl_rollback(handle); |
691 | ctrls->error_idx = (ret == -ENOENT && | 688 | ctrls->error_idx = cmd == VIDIOC_S_EXT_CTRLS |
692 | cmd == VIDIOC_S_EXT_CTRLS) | ||
693 | ? ctrls->count : i; | 689 | ? ctrls->count : i; |
694 | return ret == -ENOENT ? -EINVAL : ret; | 690 | return ret; |
695 | } | 691 | } |
696 | } | 692 | } |
697 | 693 | ||