leds: leds-lp3944, fix "sparse" warning "mixing different enum types"
authorAntonio Ospite <ospite@studenti.unina.it>
Fri, 2 Aug 2013 18:23:01 +0000 (11:23 -0700)
committerBryan Wu <cooloney@gmail.com>
Tue, 27 Aug 2013 00:22:11 +0000 (17:22 -0700)
Fix a warning from "sparse":

drivers/leds/leds-lp3944.c:292:23: warning: mixing different enum types
drivers/leds/leds-lp3944.c:292:23:     int enum led_brightness  versus
drivers/leds/leds-lp3944.c:292:23:     int enum lp3944_status

Keeping track of LP3944_LED_STATUS_OFF and LP3944_LED_STATUS_ON only in
lp3944_led_set_brightness() is OK, as the handling of DIM (blinking)
mode[s] is in lp3944_led_set_blink().

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Reviewed-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
drivers/leds/leds-lp3944.c

index 2b53d10..8e1abdc 100644 (file)
@@ -289,7 +289,7 @@ static void lp3944_led_set_brightness(struct led_classdev *led_cdev,
        dev_dbg(&led->client->dev, "%s: %s, %d\n",
                __func__, led_cdev->name, brightness);
 
-       led->status = brightness;
+       led->status = !!brightness;
        schedule_work(&led->work);
 }