From 17e23555616116e1668e83029d26354c2479c78b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Mon, 3 Apr 2017 11:38:58 +0200 Subject: [PATCH] platform/x86: fujitsu-laptop: simplify call_fext_func() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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: Michał Kępień Reviewed-by: Jonathan Woithe Signed-off-by: Darren Hart (VMware) --- drivers/platform/x86/fujitsu-laptop.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index ca1491ff659e..e5413d268b24 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c @@ -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 }; unsigned long long value; 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)) { - vdbg_printk(FUJLAPTOP_DBG_ERROR, - "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); + vdbg_printk(FUJLAPTOP_DBG_ERROR, "FUNC interface is not present\n"); return -ENODEV; } -- 2.39.5