diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2010-01-23 11:07:53 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 19:11:04 +0100 |
commit | e54532e591cd5b9ce77dbc8d9786ae9f600f101a (patch) | |
tree | 725c07637e0197acd3176827299d4186962221e4 /drivers/media/video/uvc/uvc_v4l2.c | |
parent | V4L/DVB: uvcvideo: Cache control min, max, res and def query results (diff) | |
download | linux-e54532e591cd5b9ce77dbc8d9786ae9f600f101a.tar.xz linux-e54532e591cd5b9ce77dbc8d9786ae9f600f101a.zip |
V4L/DVB: uvcvideo: Clamp control values to the minimum and maximum values
When setting a control, the V4L2 specification requires drivers to
either clamp the control value to the [minimum, maximum] range or return
the -ERANGE error.
Fix the driver to clamp control values to the valid range in
uvc_ctrl_set() and make sure the value differs from the minimum by an
integer multiple of step.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Márton Németh <nm127@freemail.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/uvc/uvc_v4l2.c')
-rw-r--r-- | drivers/media/video/uvc/uvc_v4l2.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/video/uvc/uvc_v4l2.c b/drivers/media/video/uvc/uvc_v4l2.c index 23239a4adefe..bf1fc7f29ca7 100644 --- a/drivers/media/video/uvc/uvc_v4l2.c +++ b/drivers/media/video/uvc/uvc_v4l2.c @@ -549,6 +549,8 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) return ret; } ret = uvc_ctrl_commit(chain); + if (ret == 0) + ctrl->value = xctrl.value; break; } |