Commit b65af27a authored by Thierry Reding's avatar Thierry Reding

pwm: tegra: Use NSEC_PER_SEC

Instead of using the literal value for the number of nanoseconds per
second, use the macro instead to increase readability.
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 8d6cc073
...@@ -87,7 +87,7 @@ static int tegra_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, ...@@ -87,7 +87,7 @@ static int tegra_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
* cycles at the PWM clock rate will take period_ns nanoseconds. * cycles at the PWM clock rate will take period_ns nanoseconds.
*/ */
rate = clk_get_rate(pc->clk) >> PWM_DUTY_WIDTH; rate = clk_get_rate(pc->clk) >> PWM_DUTY_WIDTH;
hz = 1000000000ul / period_ns; hz = NSEC_PER_SEC / period_ns;
rate = (rate + (hz / 2)) / hz; rate = (rate + (hz / 2)) / hz;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment