projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
caf065f
)
pwm: tegra: Use DIV_ROUND_CLOSEST_ULL() instead of local implementation
author
Laxman Dewangan
<ldewangan@nvidia.com>
Fri, 7 Apr 2017 09:33:59 +0000
(15:03 +0530)
committer
Thierry Reding
<thierry.reding@gmail.com>
Wed, 12 Apr 2017 14:08:00 +0000
(16:08 +0200)
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 <ldewangan@nvidia.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-tegra.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/pwm/pwm-tegra.c
b/drivers/pwm/pwm-tegra.c
index e4647840cd6e3129fb94da036e30470714852f14..0a688dabd6705d1da27c80309ddbeaed253995b9 100644
(file)
--- a/
drivers/pwm/pwm-tegra.c
+++ b/
drivers/pwm/pwm-tegra.c
@@
-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;