diff options
author | Jiang Liu <jiang.liu@huawei.com> | 2013-06-28 20:24:39 +0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-07-15 03:33:10 +0400 |
commit | 0db98202605c3d32e023d43c30b5bd878f520976 (patch) | |
tree | 7aec122f45db5c6b6c2f046ccf1eb9fa160fb616 /drivers/acpi/sleep.c | |
parent | 952c63e9512b63220886105cfc791507046fa39a (diff) | |
download | linux-0db98202605c3d32e023d43c30b5bd878f520976.tar.xz |
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]; static void acpi_sleep_tts_switch(u32 acpi_state) { - union acpi_object in_arg = { ACPI_TYPE_INTEGER }; - struct acpi_object_list arg_list = { 1, &in_arg }; - acpi_status status = AE_OK; + acpi_status status; - in_arg.integer.value = acpi_state; - status = acpi_evaluate_object(NULL, "\\_TTS", &arg_list, NULL); + status = acpi_execute_simple_method(NULL, "\\_TTS", acpi_state); if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { /* * OS can't evaluate the _TTS object correctly. Some warning |