diff options
-rw-r--r-- | drivers/platform/x86/intel-smartconnect.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/platform/x86/intel-smartconnect.c b/drivers/platform/x86/intel-smartconnect.c index 898400865f40..1838400dc036 100644 --- a/drivers/platform/x86/intel-smartconnect.c +++ b/drivers/platform/x86/intel-smartconnect.c | |||
@@ -25,28 +25,18 @@ MODULE_LICENSE("GPL"); | |||
25 | 25 | ||
26 | static int smartconnect_acpi_init(struct acpi_device *acpi) | 26 | static int smartconnect_acpi_init(struct acpi_device *acpi) |
27 | { | 27 | { |
28 | struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL }; | 28 | unsigned long long value; |
29 | union acpi_object *result; | ||
30 | acpi_status status; | 29 | acpi_status status; |
31 | 30 | ||
32 | status = acpi_evaluate_object(acpi->handle, "GAOS", NULL, &output); | 31 | status = acpi_evaluate_integer(acpi->handle, "GAOS", NULL, &value); |
33 | if (!ACPI_SUCCESS(status)) | 32 | if (!ACPI_SUCCESS(status)) |
34 | return -EINVAL; | 33 | return -EINVAL; |
35 | 34 | ||
36 | result = output.pointer; | 35 | if (value & 0x1) { |
37 | |||
38 | if (result->type != ACPI_TYPE_INTEGER) { | ||
39 | kfree(result); | ||
40 | return -EINVAL; | ||
41 | } | ||
42 | |||
43 | if (result->integer.value & 0x1) { | ||
44 | dev_info(&acpi->dev, "Disabling Intel Smart Connect\n"); | 36 | dev_info(&acpi->dev, "Disabling Intel Smart Connect\n"); |
45 | status = acpi_execute_simple_method(acpi->handle, "SAOS", 0); | 37 | status = acpi_execute_simple_method(acpi->handle, "SAOS", 0); |
46 | } | 38 | } |
47 | 39 | ||
48 | kfree(result); | ||
49 | |||
50 | return 0; | 40 | return 0; |
51 | } | 41 | } |
52 | 42 | ||