Skip to content

Commit

Permalink
asus-laptop: no need to check argument of set_brightness()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Corentin Chary committed Feb 28, 2010
1 parent c45eecf commit e5b50f6
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions drivers/platform/x86/asus-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e5b50f6

Please sign in to comment.