regulator: Use DIV_ROUND_CLOSEST in wm8350_isink_get_current
PATCH 1/1 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 <[email protected]>
--- drivers/regulator/wm8350-regulator.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/regulator/wm8350-regulator.c +1 -1
@@ -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 */
Signature · 1 line
1.7.5.4
Mark Brown
AppliedQuoted 1 line · Axel Lin
DIV_ROUND_CLOSESTperforms the computation (x + d/2)/d with better readability.
Applied, thanks.