Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dce7304f authored by Axel Lin's avatar Axel Lin Committed by Mark Brown
Browse files

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: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 85c5d86d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 */