asus-laptop: no need to check argument of set_brightness()
authorCorentin Chary <corentincj@iksaif.net>
Sat, 28 Nov 2009 09:19:55 +0000 (10:19 +0100)
committerCorentin Chary <corentincj@iksaif.net>
Sun, 28 Feb 2010 18:35:09 +0000 (19:35 +0100)
We already tell the backlight class our maximum brightness value; it
will validate the user requested values for us.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
drivers/platform/x86/asus-laptop.c

index 1d799b3..013ab86 100644 (file)
@@ -571,17 +571,11 @@ static int read_brightness(struct backlight_device *bd)
 
 static int set_brightness(struct backlight_device *bd, int value)
 {
-       int ret = 0;
-
-       value = (0 < value) ? ((15 < value) ? 15 : value) : 0;
-       /* 0 <= value <= 15 */
-
        if (write_acpi_int(brightness_set_handle, NULL, value, NULL)) {
                pr_warning("Error changing brightness\n");
-               ret = -EIO;
+               return -EIO;
        }
-
-       return ret;
+       return 0;
 }
 
 static int update_bl_status(struct backlight_device *bd)