Skip to content

Commit 5bd0b90

Browse files
Guru Das Srinageshthierryreding
authored andcommitted
pwm: clps711x: Use 64-bit division macro
Since the PWM framework is switching struct pwm_args.period's datatype to u64, prepare for this transition by using DIV64_U64_ROUND_CLOSEST to handle a 64-bit divisor. Cc: Daniel Thompson <[email protected]> Signed-off-by: Guru Das Srinagesh <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent f3e4b14 commit 5bd0b90

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pwm/pwm-clps711x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static void clps711x_pwm_update_val(struct clps711x_chip *priv, u32 n, u32 v)
4343
static unsigned int clps711x_get_duty(struct pwm_device *pwm, unsigned int v)
4444
{
4545
/* Duty cycle 0..15 max */
46-
return DIV_ROUND_CLOSEST(v * 0xf, pwm->args.period);
46+
return DIV64_U64_ROUND_CLOSEST(v * 0xf, pwm->args.period);
4747
}
4848

4949
static int clps711x_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm)

0 commit comments

Comments
 (0)