diff options
Diffstat (limited to 'drivers/media/video/v4l1-compat.c')
-rw-r--r-- | drivers/media/video/v4l1-compat.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/media/video/v4l1-compat.c b/drivers/media/video/v4l1-compat.c index 02f2a6d18b45..761fbd64db58 100644 --- a/drivers/media/video/v4l1-compat.c +++ b/drivers/media/video/v4l1-compat.c | |||
@@ -76,9 +76,8 @@ get_v4l_control(struct file *file, | |||
76 | dprintk("VIDIOC_G_CTRL: %d\n", err); | 76 | dprintk("VIDIOC_G_CTRL: %d\n", err); |
77 | return 0; | 77 | return 0; |
78 | } | 78 | } |
79 | return ((ctrl2.value - qctrl2.minimum) * 65535 | 79 | return DIV_ROUND_CLOSEST((ctrl2.value-qctrl2.minimum) * 65535, |
80 | + (qctrl2.maximum - qctrl2.minimum) / 2) | 80 | qctrl2.maximum - qctrl2.minimum); |
81 | / (qctrl2.maximum - qctrl2.minimum); | ||
82 | } | 81 | } |
83 | return 0; | 82 | return 0; |
84 | } | 83 | } |