diff options
author | Corentin Chary <corentincj@iksaif.net> | 2009-11-28 04:19:55 -0500 |
---|---|---|
committer | Corentin Chary <corentincj@iksaif.net> | 2010-02-28 13:35:09 -0500 |
commit | e5b50f6a2b00de266f03c2c7219b798648124ea5 (patch) | |
tree | 609c9861cfdebcc9ae129c060ddfb6089e8df9f1 | |
parent | c45eecf8719e0b2090c8a71bdc31e39d00746c84 (diff) |
asus-laptop: no need to check argument of set_brightness()
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>
-rw-r--r-- | drivers/platform/x86/asus-laptop.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c index 1d799b3fc4e8..013ab86b1c8d 100644 --- a/drivers/platform/x86/asus-laptop.c +++ b/drivers/platform/x86/asus-laptop.c | |||
@@ -571,17 +571,11 @@ static int read_brightness(struct backlight_device *bd) | |||
571 | 571 | ||
572 | static int set_brightness(struct backlight_device *bd, int value) | 572 | static int set_brightness(struct backlight_device *bd, int value) |
573 | { | 573 | { |
574 | int ret = 0; | ||
575 | |||
576 | value = (0 < value) ? ((15 < value) ? 15 : value) : 0; | ||
577 | /* 0 <= value <= 15 */ | ||
578 | |||
579 | if (write_acpi_int(brightness_set_handle, NULL, value, NULL)) { | 574 | if (write_acpi_int(brightness_set_handle, NULL, value, NULL)) { |
580 | pr_warning("Error changing brightness\n"); | 575 | pr_warning("Error changing brightness\n"); |
581 | ret = -EIO; | 576 | return -EIO; |
582 | } | 577 | } |
583 | 578 | return 0; | |
584 | return ret; | ||
585 | } | 579 | } |
586 | 580 | ||
587 | static int update_bl_status(struct backlight_device *bd) | 581 | static int update_bl_status(struct backlight_device *bd) |