hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/hid/hid-elan.c
....@@ -1,14 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * HID Driver for ELAN Touchpad
34 *
45 * Currently only supports touchpad found on HP Pavilion X2 10
56 *
67 * Copyright (c) 2016 Alexandrov Stanislav <neko@nya.ai>
7
- *
8
- * This program is free software; you can redistribute it and/or modify it
9
- * under the terms of the GNU General Public License as published by the Free
10
- * Software Foundation; either version 2 of the License, or (at your option)
11
- * any later version.
128 */
139
1410 #include <linux/hid.h>
....@@ -192,7 +188,6 @@
192188 ret = input_mt_init_slots(input, ELAN_MAX_FINGERS, INPUT_MT_POINTER);
193189 if (ret) {
194190 hid_err(hdev, "Failed to init elan MT slots: %d\n", ret);
195
- input_free_device(input);
196191 return ret;
197192 }
198193
....@@ -204,7 +199,6 @@
204199 hid_err(hdev, "Failed to register elan input device: %d\n",
205200 ret);
206201 input_mt_destroy_slots(input);
207
- input_free_device(input);
208202 return ret;
209203 }
210204
....@@ -395,7 +389,7 @@
395389 * This byte sequence will enable multitouch mode and disable
396390 * mouse emulation
397391 */
398
- const unsigned char buf[] = { 0x0D, 0x00, 0x03, 0x21, 0x00 };
392
+ static const unsigned char buf[] = { 0x0D, 0x00, 0x03, 0x21, 0x00 };
399393 unsigned char *dmabuf = kmemdup(buf, sizeof(buf), GFP_KERNEL);
400394
401395 if (!dmabuf)
....@@ -499,7 +493,7 @@
499493 return 0;
500494
501495 if (!drvdata->input) {
502
- hid_err(hdev, "Input device is not registred\n");
496
+ hid_err(hdev, "Input device is not registered\n");
503497 ret = -ENAVAIL;
504498 goto err;
505499 }