From 458356586a2874891c7265e6469f92cbba381a6b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lothar=20Wa=C3=9Fmann?= Date: Tue, 5 Nov 2013 16:30:14 +0100 Subject: [PATCH] pwm-backlight: use duty_cycle rather than brightness value to decide whether to shutdown PWM MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Lothar Waßmann --- drivers/video/backlight/pwm_bl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 368232af78d2..17e0cef59ede 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -111,8 +111,8 @@ static int pwm_backlight_update_status(struct backlight_device *bl) if (pb->notify) brightness = pb->notify(pb->dev, brightness); - if (brightness > 0) { - duty_cycle = compute_duty_cycle(pb, brightness); + duty_cycle = compute_duty_cycle(pb, brightness); + if (duty_cycle > 0) { pwm_config(pb->pwm, duty_cycle, pb->period); pwm_backlight_power_on(pb, brightness); } else -- 2.39.2