Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1587506

[PATCH 1/4] platform/x86: intel-hid: simplify enabling/disabling HID events

From Michał Kępień <kernel@kempniu.pl>
Newsgroups linux.kernel
Subject [PATCH 1/4] platform/x86: intel-hid: simplify enabling/disabling HID events
Date 2017-02-24 11:40 +0100
Message-ID <tels6-7i4-13@gated-at.bofh.it> (permalink)
References <tels5-7i4-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


ACPI method HDSM takes a single integer argument.  Use
acpi_execute_simple_method() instead of acpi_evaluate_object() for
calling that ACPI method to simplify code and reduce the number of local
variables inside intel_hid_set_enable().

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
---
 drivers/platform/x86/intel-hid.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/x86/intel-hid.c b/drivers/platform/x86/intel-hid.c
index bcf438f38781..4d1c5eb3a96d 100644
--- a/drivers/platform/x86/intel-hid.c
+++ b/drivers/platform/x86/intel-hid.c
@@ -79,12 +79,10 @@ struct intel_hid_priv {
 
 static int intel_hid_set_enable(struct device *device, int enable)
 {
-	union acpi_object arg0 = { ACPI_TYPE_INTEGER };
-	struct acpi_object_list args = { 1, &arg0 };
 	acpi_status status;
 
-	arg0.integer.value = enable;
-	status = acpi_evaluate_object(ACPI_HANDLE(device), "HDSM", &args, NULL);
+	status = acpi_execute_simple_method(ACPI_HANDLE(device), "HDSM",
+					    enable);
 	if (ACPI_FAILURE(status)) {
 		dev_warn(device, "failed to %sable hotkeys\n",
 			 enable ? "en" : "dis");
-- 
2.11.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] Improve intel-hid's self-consistency Michał Kępień <kernel@kempniu.pl> - 2017-02-24 11:40 +0100
  [PATCH 1/4] platform/x86: intel-hid: simplify enabling/disabling HID events Michał Kępień <kernel@kempniu.pl> - 2017-02-24 11:40 +0100
  [PATCH 3/4] platform/x86: intel-hid: use devm_input_allocate_device() for HID events input device Michał Kępień <kernel@kempniu.pl> - 2017-02-24 11:40 +0100
  [PATCH 4/4] platform/x86: intel-hid: remove redundant set_bit() call Michał Kępień <kernel@kempniu.pl> - 2017-02-24 11:40 +0100

csiph-web