platform/x86: intel-hid: simplify enabling/disabling HID events
authorMichał Kępień <kernel@kempniu.pl>
Fri, 24 Feb 2017 10:33:06 +0000 (11:33 +0100)
committerDarren Hart <dvhart@infradead.org>
Wed, 15 Mar 2017 05:57:09 +0000 (22:57 -0700)
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>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-and-tested-by: Alex Hung <alex.hung@canonical.com>
drivers/platform/x86/intel-hid.c

index bcf438f38781019a2db04847e77aa4bfce023eee..4d1c5eb3a96d63369f3df06c4b915ddaacf43277 100644 (file)
@@ -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");