Skip to content

Commit

Permalink
pwm: lpc18xx-sct: Fix a comment to match code
Browse files Browse the repository at this point in the history
lpc18xx_pwm_probe() only ensures clk_rate <= NSEC_PER_SEC, the following
reasoning is right even under this slightly lesser condition.

Fixes: 8933d30 ("pwm: lpc18xx: Fix period handling")
Acked-by: Vladimir Zapolskiy <vz@mleia.com>
Link: https://lore.kernel.org/r/20221108153013.132514-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
  • Loading branch information
Uwe Kleine-König authored and Thierry Reding committed Dec 6, 2022
1 parent 0b5ef34 commit 07d8d8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pwm/pwm-lpc18xx-sct.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ static void lpc18xx_pwm_config_duty(struct pwm_chip *chip,
u32 val;

/*
* With clk_rate < NSEC_PER_SEC this cannot overflow.
* With clk_rate <= NSEC_PER_SEC this cannot overflow.
* With duty_ns <= period_ns < max_period_ns this also fits into an u32.
*/
val = mul_u64_u64_div_u64(duty_ns, lpc18xx_pwm->clk_rate, NSEC_PER_SEC);
Expand Down

0 comments on commit 07d8d8d

Please sign in to comment.