Acer WMID_GUID1/2 method's return value was declared to integer
type on Gateway notebook.
So, add this patch for support integer return type.

Reference: bko#33032
        https://bugzilla.kernel.org/show_bug.cgi?id=33032

Tested on Gateway NV5909H laptop

Tested-by: Filipus Klutiero <[email protected]>
Cc: Carlos Corbacho <[email protected]>
Cc: Matthew Garrett <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Corentin Chary <[email protected]>
Cc: Thomas Renninger <[email protected]>
Signed-off-by: Lee, Chun-Yi <[email protected]>
---
 drivers/platform/x86/acer-wmi.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index 64b7e20..36e6ab4 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -754,6 +754,8 @@ WMI_execute_u32(u32 method_id, u32 in, u32 *out)
                (obj->buffer.length == sizeof(u32) ||
                obj->buffer.length == sizeof(u64))) {
                tmp = *((u32 *) obj->buffer.pointer);
+       } else if (obj->type == ACPI_TYPE_INTEGER) {
+               tmp = (u32) obj->integer.value;
        } else {
                tmp = 0;
        }
@@ -884,6 +886,8 @@ static acpi_status WMID_set_capabilities(void)
                (obj->buffer.length == sizeof(u32) ||
                obj->buffer.length == sizeof(u64))) {
                devices = *((u32 *) obj->buffer.pointer);
+       } else if (obj->type == ACPI_TYPE_INTEGER) {
+               devices = (u32) obj->integer.value;
        } else {
                kfree(out.pointer);
                return AE_ERROR;
@@ -1589,6 +1593,8 @@ static u32 get_wmid_devices(void)
                (obj->buffer.length == sizeof(u32) ||
                obj->buffer.length == sizeof(u64))) {
                devices = *((u32 *) obj->buffer.pointer);
+       } else if (obj->type == ACPI_TYPE_INTEGER) {
+               devices = (u32) obj->integer.value;
        }
 
        kfree(out.pointer);
-- 
1.6.0.2

--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" 
in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to