hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/input/tablet/aiptek.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Native support for the Aiptek HyperPen USB Tablets
34 * (4000U/5000U/6000U/8000U/12000U)
....@@ -54,20 +55,6 @@
5455 * so therefore it's easier to document them all as one subsystem.
5556 * Please visit the project's "home page", located at,
5657 * http://aiptektablet.sourceforge.net.
57
- *
58
- * This program is free software; you can redistribute it and/or modify
59
- * it under the terms of the GNU General Public License as published by
60
- * the Free Software Foundation; either version 2 of the License, or
61
- * (at your option) any later version.
62
- *
63
- * This program is distributed in the hope that it will be useful,
64
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
65
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
66
- * GNU General Public License for more details.
67
- *
68
- * You should have received a copy of the GNU General Public License
69
- * along with this program; if not, write to the Free Software
70
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
7158 */
7259
7360 #include <linux/jiffies.h>
....@@ -1726,7 +1713,7 @@
17261713
17271714 aiptek->inputdev = inputdev;
17281715 aiptek->intf = intf;
1729
- aiptek->ifnum = intf->altsetting[0].desc.bInterfaceNumber;
1716
+ aiptek->ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
17301717 aiptek->inDelay = 0;
17311718 aiptek->endDelay = 0;
17321719 aiptek->previousJitterable = 0;
....@@ -1814,15 +1801,13 @@
18141801 input_set_abs_params(inputdev, ABS_TILT_Y, AIPTEK_TILT_MIN, AIPTEK_TILT_MAX, 0, 0);
18151802 input_set_abs_params(inputdev, ABS_WHEEL, AIPTEK_WHEEL_MIN, AIPTEK_WHEEL_MAX - 1, 0, 0);
18161803
1817
- /* Verify that a device really has an endpoint */
1818
- if (intf->cur_altsetting->desc.bNumEndpoints < 1) {
1804
+ err = usb_find_common_endpoints(intf->cur_altsetting,
1805
+ NULL, NULL, &endpoint, NULL);
1806
+ if (err) {
18191807 dev_err(&intf->dev,
1820
- "interface has %d endpoints, but must have minimum 1\n",
1821
- intf->cur_altsetting->desc.bNumEndpoints);
1822
- err = -EINVAL;
1808
+ "interface has no int in endpoints, but must have minimum 1\n");
18231809 goto fail3;
18241810 }
1825
- endpoint = &intf->cur_altsetting->endpoint[0].desc;
18261811
18271812 /* Go set up our URB, which is called when the tablet receives
18281813 * input.