Skip to content

Commit fcdea6b

Browse files
Guru Das Srinageshthierryreding
authored andcommitted
pwm: imx-tpm: Use 64-bit division macro
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]>
1 parent 5bd0b90 commit fcdea6b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pwm/pwm-imx-tpm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ static int pwm_imx_tpm_round_state(struct pwm_chip *chip,
124124
real_state->duty_cycle = state->duty_cycle;
125125

126126
tmp = (u64)p->mod * real_state->duty_cycle;
127-
p->val = DIV_ROUND_CLOSEST_ULL(tmp, real_state->period);
127+
p->val = DIV64_U64_ROUND_CLOSEST(tmp, real_state->period);
128128

129129
real_state->polarity = state->polarity;
130130
real_state->enabled = state->enabled;

0 commit comments

Comments
 (0)