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/utils.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/utils.c')
-rw-r--r-- | drivers/acpi/utils.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index b08d97376f84..87b85882b5df 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c | |||
@@ -510,3 +510,15 @@ bool acpi_has_method(acpi_handle handle, char *name) | |||
510 | return ACPI_SUCCESS(acpi_get_handle(handle, name, &tmp)); | 510 | return ACPI_SUCCESS(acpi_get_handle(handle, name, &tmp)); |
511 | } | 511 | } |
512 | EXPORT_SYMBOL(acpi_has_method); | 512 | EXPORT_SYMBOL(acpi_has_method); |
513 | |||
514 | acpi_status acpi_execute_simple_method(acpi_handle handle, char *method, | ||
515 | u64 arg) | ||
516 | { | ||
517 | union acpi_object obj = { .type = ACPI_TYPE_INTEGER }; | ||
518 | struct acpi_object_list arg_list = { .count = 1, .pointer = &obj, }; | ||
519 | |||
520 | obj.integer.value = arg; | ||
521 | |||
522 | return acpi_evaluate_object(handle, method, &arg_list, NULL); | ||
523 | } | ||
524 | EXPORT_SYMBOL(acpi_execute_simple_method); | ||