Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh...
[pandora-kernel.git] / drivers / acpi / toshiba_acpi.c
index 88aeccb..faf8a52 100644 (file)
@@ -125,7 +125,7 @@ static int write_acpi_int(const char *methodName, int val)
        union acpi_object in_objs[1];
        acpi_status status;
 
-       params.count = sizeof(in_objs) / sizeof(in_objs[0]);
+       params.count = ARRAY_SIZE(in_objs);
        params.pointer = in_objs;
        in_objs[0].type = ACPI_TYPE_INTEGER;
        in_objs[0].integer.value = val;
@@ -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;
 }
 
@@ -558,10 +561,6 @@ static int __init toshiba_acpi_init(void)
        if (acpi_disabled)
                return -ENODEV;
 
-       if (!acpi_specific_hotkey_enabled) {
-               printk(MY_INFO "Using generic hotkey driver\n");
-               return -ENODEV;
-       }
        /* simple device detection: look for HCI method */
        if (is_valid_acpi_path(METHOD_HCI_1))
                method_hci = METHOD_HCI_1;