]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
pwm-backlight: use duty_cycle rather than brightness value to decide whether to shutd...
authorLothar Waßmann <LW@KARO-electronics.de>
Tue, 5 Nov 2013 15:30:14 +0000 (16:30 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 5 Nov 2013 21:43:33 +0000 (22:43 +0100)
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
drivers/video/backlight/pwm_bl.c

index 368232af78d29fb714fa6462ed354c8a947c9846..17e0cef59edec16dc6ca8b8adbde1a4f59cd01e4 100644 (file)
@@ -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