summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l1-compat.c
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2009-09-20 14:55:36 +0200
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-09-20 14:55:36 +0200
commit6469f540ea37d53db089c8fea9c0c77a3d9353d4 (patch)
tree1dc9dc077150d57f4424cae49e711b5dd6e903a1 /drivers/media/video/v4l1-compat.c
parentm25p80: Add Spansion S25FL129P serial flashes (diff)
parentMerge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/k... (diff)
downloadlinux-6469f540ea37d53db089c8fea9c0c77a3d9353d4.tar.xz
linux-6469f540ea37d53db089c8fea9c0c77a3d9353d4.zip
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: drivers/mtd/mtdcore.c Merged in order that I can apply the Nomadik nand/onenand support patches.
Diffstat (limited to 'drivers/media/video/v4l1-compat.c')
-rw-r--r--drivers/media/video/v4l1-compat.c5
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,
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;
}