mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
pwm: tegra: Use DIV_ROUND_CLOSEST_ULL() instead of local implementation
Use macro DIV_ROUND_CLOSEST_ULL() for 64-bit division to closest one instead of implementing the same locally. This increase readability. Signed-off-by: Laxman Dewangan <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
This commit is contained in:
parent
caf065f8fd
commit
90241fb9b5
1 changed files with 1 additions and 2 deletions
|
|
@ -85,8 +85,7 @@ static int tegra_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
|
|||
* nearest integer during division.
|
||||
*/
|
||||
c *= (1 << PWM_DUTY_WIDTH);
|
||||
c += period_ns / 2;
|
||||
do_div(c, period_ns);
|
||||
c = DIV_ROUND_CLOSEST_ULL(c, period_ns);
|
||||
|
||||
val = (u32)c << PWM_DUTY_SHIFT;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue