Skip to content

Commit 134ada1

Browse files
Guru Das Srinageshthierryreding
authored andcommitted
backlight: pwm_bl: Use 64-bit division function
Since the PWM framework is switching struct pwm_state.period's datatype to u64, prepare for this transition by using div_u64 to handle a 64-bit dividend instead of a straight division operation. Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
1 parent c7dccca commit 134ada1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/video/backlight/pwm_bl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,8 @@ static int pwm_backlight_probe(struct platform_device *pdev)
606606
pb->scale = data->max_brightness;
607607
}
608608

609-
pb->lth_brightness = data->lth_brightness * (state.period / pb->scale);
609+
pb->lth_brightness = data->lth_brightness * (div_u64(state.period,
610+
pb->scale));
610611

611612
props.type = BACKLIGHT_RAW;
612613
props.max_brightness = data->max_brightness;

0 commit comments

Comments
 (0)