mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-24 01:09:38 -05:00
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>
This commit is contained in:
parent
85c5d86d0e
commit
dce7304f4b
1 changed files with 1 additions and 1 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Reference in a new issue