linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michał Kępień" <kernel@kempniu.pl>
To: Alex Hung <alex.hung@canonical.com>,
	Darren Hart <dvhart@infradead.org>,
	Andy Shevchenko <andy@infradead.org>
Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/4] platform/x86: intel-hid: simplify enabling/disabling HID events
Date: Fri, 24 Feb 2017 11:33:06 +0100	[thread overview]
Message-ID: <20170224103309.19463-2-kernel@kempniu.pl> (raw)
In-Reply-To: <20170224103309.19463-1-kernel@kempniu.pl>

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

  reply	other threads:[~2017-02-24 10:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-24 10:33 [PATCH 0/4] Improve intel-hid's self-consistency Michał Kępień
2017-02-24 10:33 ` Michał Kępień [this message]
2017-02-24 10:33 ` [PATCH 2/4] platform/x86: intel-hid: make intel_hid_set_enable() take a boolean argument Michał Kępień
2017-02-24 10:33 ` [PATCH 3/4] platform/x86: intel-hid: use devm_input_allocate_device() for HID events input device Michał Kępień
2017-02-24 10:33 ` [PATCH 4/4] platform/x86: intel-hid: remove redundant set_bit() call Michał Kępień
2017-03-01 23:03 ` [PATCH 0/4] Improve intel-hid's self-consistency Andy Shevchenko
2017-03-02 10:17   ` Alex Hung
2017-03-03 18:27     ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170224103309.19463-2-kernel@kempniu.pl \
    --to=kernel@kempniu.pl \
    --cc=alex.hung@canonical.com \
    --cc=andy@infradead.org \
    --cc=dvhart@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).