]> Git Repo - linux.git/commitdiff
pwm: imx-tpm: Use 64-bit division macro
authorGuru Das Srinagesh <[email protected]>
Tue, 2 Jun 2020 22:31:09 +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_state.period's datatype
to u64, prepare for this transition by using DIV64_U64_ROUND_CLOSEST to
handle a 64-bit divisor.

Cc: Shawn Guo <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Pengutronix Kernel Team <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: NXP Linux Team <[email protected]>
Signed-off-by: Guru Das Srinagesh <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
drivers/pwm/pwm-imx-tpm.c

index 5f3d7f7e6aef0aa4a738a4bd28ff84e8814a6cf7..fcdf6befb83898de984402bd4c957217ccbad80d 100644 (file)
@@ -124,7 +124,7 @@ static int pwm_imx_tpm_round_state(struct pwm_chip *chip,
                real_state->duty_cycle = state->duty_cycle;
 
        tmp = (u64)p->mod * real_state->duty_cycle;
-       p->val = DIV_ROUND_CLOSEST_ULL(tmp, real_state->period);
+       p->val = DIV64_U64_ROUND_CLOSEST(tmp, real_state->period);
 
        real_state->polarity = state->polarity;
        real_state->enabled = state->enabled;
This page took 0.054331 seconds and 4 git commands to generate.