[PATCH] fix the toshiba_acpi write_lcd return value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



the write_lcd function 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 <[email protected]>
---
 drivers/acpi/toshiba_acpi.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -up a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c
--- a/drivers/acpi/toshiba_acpi.c	2007-01-04 18:41:03.000000000 +0100
+++ b/drivers/acpi/toshiba_acpi.c	2007-01-04 19:36:32.000000000 +0100
@@ -321,11 +321,11 @@ static int set_lcd_status(struct backlig
 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)
-		ret = set_lcd(value);
+		ret = (ret = set_lcd(value)) == 0 ? count : ret;
 	else
 		ret = -EINVAL;
 	return ret;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux