diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-03-12 10:17:56 +0800 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-03-12 10:48:18 +0000 |
commit | dce7304f4b8ea9e12c1bd58747f16f579c4d7b2d (patch) | |
tree | 474c7a3fe80bc3f4efb5fc462df2087b959c4b94 /drivers/regulator | |
parent | 85c5d86d0e87bd843d711dcb7427c6ba64f736d1 (diff) | |
download | linux-stable-dce7304f4b8ea9e12c1bd58747f16f579c4d7b2d.tar.gz linux-stable-dce7304f4b8ea9e12c1bd58747f16f579c4d7b2d.tar.bz2 linux-stable-dce7304f4b8ea9e12c1bd58747f16f579c4d7b2d.zip |
regulator: Use DIV_ROUND_CLOSEST in wm8350_isink_get_current
DIV_ROUND_CLOSEST performs the computation (x + d/2)/d with better readability.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/wm8350-regulator.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c index 4f46067455c8..ab1e183a74b5 100644 --- a/drivers/regulator/wm8350-regulator.c +++ b/drivers/regulator/wm8350-regulator.c @@ -186,7 +186,7 @@ static int wm8350_isink_get_current(struct regulator_dev *rdev) return 0; } - return (isink_cur[val] + 50) / 100; + return DIV_ROUND_CLOSEST(isink_cur[val], 100); } /* turn on ISINK followed by DCDC */ |