lkml.org 
[lkml]   [2020]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[RESEND PATCH v14 05/11] pwm: pwm-imx-tpm: Use 64-bit division macro
    Date
    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.

    Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
    ---
    drivers/pwm/pwm-imx-tpm.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/pwm/pwm-imx-tpm.c b/drivers/pwm/pwm-imx-tpm.c
    index 5f3d7f7..fcdf6be 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;
    --
    The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
    a Linux Foundation Collaborative Project
    \
     
     \ /
      Last update: 2020-05-04 20:51    [W:2.956 / U:0.060 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site