mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-16 13:34:30 +00:00
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 <shawnguo@kernel.org> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Pengutronix Kernel Team <kernel@pengutronix.de> Cc: Fabio Estevam <festevam@gmail.com> Cc: NXP Linux Team <linux-imx@nxp.com> Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
This commit is contained in:
parent
5bd0b9011d
commit
fcdea6b2a3
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user