diff options
author | Guru Das Srinagesh <gurus@codeaurora.org> | 2020-06-02 15:31:09 -0700 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2020-06-16 11:16:08 +0200 |
commit | fcdea6b2a3f6508618e39e061073a18c55993a1b (patch) | |
tree | f8f4be178ecfcdfe96814b5a711e6b56844ecb60 /drivers | |
parent | 5bd0b9011da836dad1a00d92ebead7eaa87f5fe3 (diff) | |
download | linux-stable-fcdea6b2a3f6508618e39e061073a18c55993a1b.tar.gz linux-stable-fcdea6b2a3f6508618e39e061073a18c55993a1b.tar.bz2 linux-stable-fcdea6b2a3f6508618e39e061073a18c55993a1b.zip |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pwm/pwm-imx-tpm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pwm/pwm-imx-tpm.c b/drivers/pwm/pwm-imx-tpm.c index 5f3d7f7e6aef..fcdf6befb838 100644 --- a/drivers/pwm/pwm-imx-tpm.c +++ b/drivers/pwm/pwm-imx-tpm.c @@ -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; |