platform/x86: alienware-wmi: Adjust instance of wmi_evaluate_method calls to 0
authorMario Limonciello <mario.limonciello@dell.com>
Wed, 21 Jun 2017 22:01:35 +0000 (17:01 -0500)
committerDarren Hart (VMware) <dvhart@infradead.org>
Wed, 28 Jun 2017 16:01:35 +0000 (09:01 -0700)
Pali recently noticed that WMI instances are zero indexed.

The only reason that these calls all worked properly is because the ASL
didn't verify the instance number.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
drivers/platform/x86/alienware-wmi.c

index d6b34923fb4edd061ab18a57d2c8d281136f84b7..9866fec78c1c93138934967f1309014dfae89390 100644 (file)
@@ -303,7 +303,7 @@ static int alienware_update_led(struct platform_zone *zone)
        }
        pr_debug("alienware-wmi: guid %s method %d\n", guid, method_id);
 
-       status = wmi_evaluate_method(guid, 1, method_id, &input, NULL);
+       status = wmi_evaluate_method(guid, 0, method_id, &input, NULL);
        if (ACPI_FAILURE(status))
                pr_err("alienware-wmi: zone set failure: %u\n", status);
        return ACPI_FAILURE(status);
@@ -352,7 +352,7 @@ static int wmax_brightness(int brightness)
        };
        input.length = (acpi_size) sizeof(args);
        input.pointer = &args;
-       status = wmi_evaluate_method(WMAX_CONTROL_GUID, 1,
+       status = wmi_evaluate_method(WMAX_CONTROL_GUID, 0,
                                     WMAX_METHOD_BRIGHTNESS, &input, NULL);
        if (ACPI_FAILURE(status))
                pr_err("alienware-wmi: brightness set failure: %u\n", status);
@@ -506,10 +506,10 @@ static acpi_status alienware_wmax_command(struct wmax_basic_args *in_args,
        if (out_data != NULL) {
                output.length = ACPI_ALLOCATE_BUFFER;
                output.pointer = NULL;
-               status = wmi_evaluate_method(WMAX_CONTROL_GUID, 1,
+               status = wmi_evaluate_method(WMAX_CONTROL_GUID, 0,
                                             command, &input, &output);
        } else
-               status = wmi_evaluate_method(WMAX_CONTROL_GUID, 1,
+               status = wmi_evaluate_method(WMAX_CONTROL_GUID, 0,
                                             command, &input, NULL);
 
        if (ACPI_SUCCESS(status) && out_data != NULL) {