OSDN Git Service

backlight: pwm_bl: Fix overflow condition
authorDerek Basehore <dbasehore@chromium.org>
Tue, 29 Aug 2017 20:34:34 +0000 (13:34 -0700)
committerLee Jones <lee.jones@linaro.org>
Fri, 13 Oct 2017 09:41:20 +0000 (10:41 +0100)
commit5d0c49acebc9488e37db95f1d4a55644e545ffe7
tree569883e84e757a23fcde534201fdd09b332be937
parent2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e
backlight: pwm_bl: Fix overflow condition

This fixes an overflow condition that can happen with high max
brightness and period values in compute_duty_cycle. This fixes it by
using a 64 bit variable for computing the duty cycle.

Signed-off-by: Derek Basehore <dbasehore@chromium.org>
Acked-by: Thierry Reding <thierry.reding@gmail.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/video/backlight/pwm_bl.c