Commit 17e23555 authored by Michał Kępień's avatar Michał Kępień Committed by Darren Hart (VMware)

platform/x86: fujitsu-laptop: simplify call_fext_func()

acpi_evaluate_integer() takes a pathname parameter which contains the
name of the entity to evaluate underneath the given handle, so calling
acpi_get_handle() beforehand is redundant.  Replace the call to
acpi_get_handle() with a call to acpi_evaluate_integer(), thus
eliminating the need for a local variable storing the handle.  Adjust
whitespace to make checkpatch happy.
Signed-off-by: default avatarMichał Kępień <kernel@kempniu.pl>
Reviewed-by: default avatarJonathan Woithe <jwoithe@just42.net>
Signed-off-by: default avatarDarren Hart (VMware) <dvhart@infradead.org>
parent b1066410
...@@ -228,20 +228,11 @@ static int call_fext_func(int cmd, int arg0, int arg1, int arg2) ...@@ -228,20 +228,11 @@ static int call_fext_func(int cmd, int arg0, int arg1, int arg2)
struct acpi_object_list arg_list = { 4, params }; struct acpi_object_list arg_list = { 4, params };
unsigned long long value; unsigned long long value;
acpi_status status; acpi_status status;
acpi_handle handle;
status = acpi_get_handle(fujitsu_laptop->acpi_handle, "FUNC", &handle); status = acpi_evaluate_integer(fujitsu_laptop->acpi_handle, "FUNC",
&arg_list, &value);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
vdbg_printk(FUJLAPTOP_DBG_ERROR, vdbg_printk(FUJLAPTOP_DBG_ERROR, "FUNC interface is not present\n");
"FUNC interface is not present\n");
return -ENODEV;
}
status = acpi_evaluate_integer(handle, NULL, &arg_list, &value);
if (ACPI_FAILURE(status)) {
vdbg_printk(FUJLAPTOP_DBG_WARN,
"FUNC 0x%x (args 0x%x, 0x%x, 0x%x) call failed\n",
cmd, arg0, arg1, arg2);
return -ENODEV; return -ENODEV;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment