Skip to content

Commit

Permalink
pwm: tegra: Use NSEC_PER_SEC
Browse files Browse the repository at this point in the history
Instead of using the literal value for the number of nanoseconds per
second, use the macro instead to increase readability.

Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
  • Loading branch information
thierryreding committed Feb 18, 2015
1 parent 8d6cc07 commit b65af27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pwm/pwm-tegra.c
Expand Up @@ -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.
*/
rate = clk_get_rate(pc->clk) >> PWM_DUTY_WIDTH;
hz = 1000000000ul / period_ns;
hz = NSEC_PER_SEC / period_ns;

rate = (rate + (hz / 2)) / hz;

Expand Down

0 comments on commit b65af27

Please sign in to comment.