diff options
Diffstat (limited to 'drivers/platform/x86/intel-rst.c')
-rw-r--r-- | drivers/platform/x86/intel-rst.c | 48 |
1 files changed, 8 insertions, 40 deletions
diff --git a/drivers/platform/x86/intel-rst.c b/drivers/platform/x86/intel-rst.c index 41b740cb28bc..a2083a9e5662 100644 --- a/drivers/platform/x86/intel-rst.c +++ b/drivers/platform/x86/intel-rst.c | |||
@@ -29,24 +29,16 @@ static ssize_t irst_show_wakeup_events(struct device *dev, | |||
29 | char *buf) | 29 | char *buf) |
30 | { | 30 | { |
31 | struct acpi_device *acpi; | 31 | struct acpi_device *acpi; |
32 | struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL }; | 32 | unsigned long long value; |
33 | union acpi_object *result; | ||
34 | acpi_status status; | 33 | acpi_status status; |
35 | 34 | ||
36 | acpi = to_acpi_device(dev); | 35 | acpi = to_acpi_device(dev); |
37 | 36 | ||
38 | status = acpi_evaluate_object(acpi->handle, "GFFS", NULL, &output); | 37 | status = acpi_evaluate_integer(acpi->handle, "GFFS", NULL, &value); |
39 | if (!ACPI_SUCCESS(status)) | 38 | if (!ACPI_SUCCESS(status)) |
40 | return -EINVAL; | 39 | return -EINVAL; |
41 | 40 | ||
42 | result = output.pointer; | 41 | return sprintf(buf, "%lld\n", value); |
43 | |||
44 | if (result->type != ACPI_TYPE_INTEGER) { | ||
45 | kfree(result); | ||
46 | return -EINVAL; | ||
47 | } | ||
48 | |||
49 | return sprintf(buf, "%lld\n", result->integer.value); | ||
50 | } | 42 | } |
51 | 43 | ||
52 | static ssize_t irst_store_wakeup_events(struct device *dev, | 44 | static ssize_t irst_store_wakeup_events(struct device *dev, |
@@ -54,8 +46,6 @@ static ssize_t irst_store_wakeup_events(struct device *dev, | |||
54 | const char *buf, size_t count) | 46 | const char *buf, size_t count) |
55 | { | 47 | { |
56 | struct acpi_device *acpi; | 48 | struct acpi_device *acpi; |
57 | struct acpi_object_list input; | ||
58 | union acpi_object param; | ||
59 | acpi_status status; | 49 | acpi_status status; |
60 | unsigned long value; | 50 | unsigned long value; |
61 | int error; | 51 | int error; |
@@ -67,13 +57,7 @@ static ssize_t irst_store_wakeup_events(struct device *dev, | |||
67 | if (error) | 57 | if (error) |
68 | return error; | 58 | return error; |
69 | 59 | ||
70 | param.type = ACPI_TYPE_INTEGER; | 60 | status = acpi_execute_simple_method(acpi->handle, "SFFS", value); |
71 | param.integer.value = value; | ||
72 | |||
73 | input.count = 1; | ||
74 | input.pointer = ¶m; | ||
75 | |||
76 | status = acpi_evaluate_object(acpi->handle, "SFFS", &input, NULL); | ||
77 | 61 | ||
78 | if (!ACPI_SUCCESS(status)) | 62 | if (!ACPI_SUCCESS(status)) |
79 | return -EINVAL; | 63 | return -EINVAL; |
@@ -91,24 +75,16 @@ static ssize_t irst_show_wakeup_time(struct device *dev, | |||
91 | struct device_attribute *attr, char *buf) | 75 | struct device_attribute *attr, char *buf) |
92 | { | 76 | { |
93 | struct acpi_device *acpi; | 77 | struct acpi_device *acpi; |
94 | struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL }; | 78 | unsigned long long value; |
95 | union acpi_object *result; | ||
96 | acpi_status status; | 79 | acpi_status status; |
97 | 80 | ||
98 | acpi = to_acpi_device(dev); | 81 | acpi = to_acpi_device(dev); |
99 | 82 | ||
100 | status = acpi_evaluate_object(acpi->handle, "GFTV", NULL, &output); | 83 | status = acpi_evaluate_integer(acpi->handle, "GFTV", NULL, &value); |
101 | if (!ACPI_SUCCESS(status)) | 84 | if (!ACPI_SUCCESS(status)) |
102 | return -EINVAL; | 85 | return -EINVAL; |
103 | 86 | ||
104 | result = output.pointer; | 87 | return sprintf(buf, "%lld\n", value); |
105 | |||
106 | if (result->type != ACPI_TYPE_INTEGER) { | ||
107 | kfree(result); | ||
108 | return -EINVAL; | ||
109 | } | ||
110 | |||
111 | return sprintf(buf, "%lld\n", result->integer.value); | ||
112 | } | 88 | } |
113 | 89 | ||
114 | static ssize_t irst_store_wakeup_time(struct device *dev, | 90 | static ssize_t irst_store_wakeup_time(struct device *dev, |
@@ -116,8 +92,6 @@ static ssize_t irst_store_wakeup_time(struct device *dev, | |||
116 | const char *buf, size_t count) | 92 | const char *buf, size_t count) |
117 | { | 93 | { |
118 | struct acpi_device *acpi; | 94 | struct acpi_device *acpi; |
119 | struct acpi_object_list input; | ||
120 | union acpi_object param; | ||
121 | acpi_status status; | 95 | acpi_status status; |
122 | unsigned long value; | 96 | unsigned long value; |
123 | int error; | 97 | int error; |
@@ -129,13 +103,7 @@ static ssize_t irst_store_wakeup_time(struct device *dev, | |||
129 | if (error) | 103 | if (error) |
130 | return error; | 104 | return error; |
131 | 105 | ||
132 | param.type = ACPI_TYPE_INTEGER; | 106 | status = acpi_execute_simple_method(acpi->handle, "SFTV", value); |
133 | param.integer.value = value; | ||
134 | |||
135 | input.count = 1; | ||
136 | input.pointer = ¶m; | ||
137 | |||
138 | status = acpi_evaluate_object(acpi->handle, "SFTV", &input, NULL); | ||
139 | 107 | ||
140 | if (!ACPI_SUCCESS(status)) | 108 | if (!ACPI_SUCCESS(status)) |
141 | return -EINVAL; | 109 | return -EINVAL; |