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 <[email protected]> Reviewed-by: Daniel Thompson <[email protected]> Acked-by: Lee Jones <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent c7dccca commit 134ada1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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)