diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-09-15 13:56:01 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-09-15 13:56:01 -0300 |
commit | 136a9b83fb4cb819c2f27cbb5948d26cec0e7934 (patch) | |
tree | 397919f977ae7937aa60a5001f62f0ba3faef2db /linux/drivers/media/video/v4l1-compat.c | |
parent | fdafaa4f7e2ea516dbd7791f362f05273aaaa6cc (diff) | |
parent | c5d1ee111d9e00f9ce75e48e5e3806fdcd681a83 (diff) | |
download | mediapointer-dvb-s2-136a9b83fb4cb819c2f27cbb5948d26cec0e7934.tar.gz mediapointer-dvb-s2-136a9b83fb4cb819c2f27cbb5948d26cec0e7934.tar.bz2 |
merge: http://kernellabs.com/hg/~mkrufky/tda18271-merge
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/v4l1-compat.c')
-rw-r--r-- | linux/drivers/media/video/v4l1-compat.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/linux/drivers/media/video/v4l1-compat.c b/linux/drivers/media/video/v4l1-compat.c index ee3991f2f..2225243ad 100644 --- a/linux/drivers/media/video/v4l1-compat.c +++ b/linux/drivers/media/video/v4l1-compat.c @@ -77,9 +77,8 @@ get_v4l_control(struct file *file, dprintk("VIDIOC_G_CTRL: %d\n", err); return 0; } - return ((ctrl2.value - qctrl2.minimum) * 65535 - + (qctrl2.maximum - qctrl2.minimum) / 2) - / (qctrl2.maximum - qctrl2.minimum); + return DIV_ROUND_CLOSEST((ctrl2.value-qctrl2.minimum) * 65535, + qctrl2.maximum - qctrl2.minimum); } return 0; } |