]> Git Repo - linux.git/commitdiff
pwm: clps711x: Use 64-bit division macro
authorGuru Das Srinagesh <[email protected]>
Tue, 2 Jun 2020 22:31:08 +0000 (15:31 -0700)
committerThierry Reding <[email protected]>
Tue, 16 Jun 2020 09:16:08 +0000 (11:16 +0200)
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]>
drivers/pwm/pwm-clps711x.c

index 924d39a797cf762f33586fa114c7310e78e01a3d..ba9500aca078a5240e6db012e5f48b4cb78a2ace 100644 (file)
@@ -43,7 +43,7 @@ static void clps711x_pwm_update_val(struct clps711x_chip *priv, u32 n, u32 v)
 static unsigned int clps711x_get_duty(struct pwm_device *pwm, unsigned int v)
 {
        /* Duty cycle 0..15 max */
-       return DIV_ROUND_CLOSEST(v * 0xf, pwm->args.period);
+       return DIV64_U64_ROUND_CLOSEST(v * 0xf, pwm->args.period);
 }
 
 static int clps711x_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm)
This page took 0.053998 seconds and 4 git commands to generate.