diff options
author | Jiang Liu <jiang.liu@huawei.com> | 2013-06-28 12:24:39 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-07-14 19:33:10 -0400 |
commit | 0db98202605c3d32e023d43c30b5bd878f520976 (patch) | |
tree | 7aec122f45db5c6b6c2f046ccf1eb9fa160fb616 /drivers/acpi/sleep.c | |
parent | 952c63e9512b63220886105cfc791507046fa39a (diff) |
ACPI: introduce helper function acpi_execute_simple_method()
Introduce helper function acpi_execute_simple_method() and use it in
a number of places to simplify code.
[rjw: Changelog]
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/sleep.c')
-rw-r--r-- | drivers/acpi/sleep.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 187ab61889e6..81b0f03d97db 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
@@ -31,12 +31,9 @@ static u8 sleep_states[ACPI_S_STATE_COUNT]; | |||
31 | 31 | ||
32 | static void acpi_sleep_tts_switch(u32 acpi_state) | 32 | static void acpi_sleep_tts_switch(u32 acpi_state) |
33 | { | 33 | { |
34 | union acpi_object in_arg = { ACPI_TYPE_INTEGER }; | 34 | acpi_status status; |
35 | struct acpi_object_list arg_list = { 1, &in_arg }; | ||
36 | acpi_status status = AE_OK; | ||
37 | 35 | ||
38 | in_arg.integer.value = acpi_state; | 36 | status = acpi_execute_simple_method(NULL, "\\_TTS", acpi_state); |
39 | status = acpi_evaluate_object(NULL, "\\_TTS", &arg_list, NULL); | ||
40 | if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { | 37 | if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { |
41 | /* | 38 | /* |
42 | * OS can't evaluate the _TTS object correctly. Some warning | 39 | * OS can't evaluate the _TTS object correctly. Some warning |