Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c8af57eb76fbd70c7f5b421b065fd55d096e2bff
Commit:     c8af57eb76fbd70c7f5b421b065fd55d096e2bff
Parent:     73b8ed29ab3f6ad7204b4e61cfa87dc0c28d3019
Author:     Matthijs van Otterdijk <[EMAIL PROTECTED]>
AuthorDate: Fri Jan 5 16:37:03 2007 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri Jan 5 23:55:29 2007 -0800

    [PATCH] fix the toshiba_acpi write_lcd return value
    
    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 <[EMAIL PROTECTED]>
    Cc: Len Brown <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/acpi/toshiba_acpi.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c
index 88aeccb..d9b651f 100644
--- a/drivers/acpi/toshiba_acpi.c
+++ b/drivers/acpi/toshiba_acpi.c
@@ -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;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to