提交 93ed2490 编写于 作者: M Michał Kępień 提交者: Darren Hart

platform/x86: intel-hid: simplify enabling/disabling HID events

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: NMichał Kępień <kernel@kempniu.pl>
Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-and-tested-by: NAlex Hung <alex.hung@canonical.com>
上级 ae50dfd6
......@@ -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");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册