summaryrefslogtreecommitdiff
path: root/drivers/acpi/utils.c
diff options
context:
space:
mode:
authorJiang Liu <jiang.liu@huawei.com>2013-06-29 00:24:39 +0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-07-15 01:33:10 +0200
commit0db98202605c3d32e023d43c30b5bd878f520976 (patch)
tree7aec122f45db5c6b6c2f046ccf1eb9fa160fb616 /drivers/acpi/utils.c
parent952c63e9512b63220886105cfc791507046fa39a (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.c12
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)
return ACPI_SUCCESS(acpi_get_handle(handle, name, &tmp));
}
EXPORT_SYMBOL(acpi_has_method);
+
+acpi_status acpi_execute_simple_method(acpi_handle handle, char *method,
+ u64 arg)
+{
+ union acpi_object obj = { .type = ACPI_TYPE_INTEGER };
+ struct acpi_object_list arg_list = { .count = 1, .pointer = &obj, };
+
+ obj.integer.value = arg;
+
+ return acpi_evaluate_object(handle, method, &arg_list, NULL);
+}
+EXPORT_SYMBOL(acpi_execute_simple_method);