Skip to content

Commit

Permalink
[PATCH] fix the toshiba_acpi write_lcd return value
Browse files Browse the repository at this point in the history
write_lcd() in toshiba_acpi returns 0 on success since the big ACPI patch
merged in 2.6.20-rc2.  It should return count.

Signed-off-by: Matthijs van Otterdijk <thotter@gmail.com>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Matthijs van Otterdijk authored and Linus Torvalds committed Jan 6, 2007
1 parent 73b8ed2 commit c8af57e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/acpi/toshiba_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,16 @@ static int set_lcd_status(struct backlight_device *bd)
static unsigned long write_lcd(const char *buffer, unsigned long count)
{
int value;
int ret = count;
int ret;

if (sscanf(buffer, " brightness : %i", &value) == 1 &&
value >= 0 && value < HCI_LCD_BRIGHTNESS_LEVELS)
value >= 0 && value < HCI_LCD_BRIGHTNESS_LEVELS) {
ret = set_lcd(value);
else
if (ret == 0)
ret = count;
} else {
ret = -EINVAL;
}
return ret;
}

Expand Down

0 comments on commit c8af57e

Please sign in to comment.