| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Native support for the Aiptek HyperPen USB Tablets |
|---|
| 3 | 4 | * (4000U/5000U/6000U/8000U/12000U) |
|---|
| .. | .. |
|---|
| 54 | 55 | * so therefore it's easier to document them all as one subsystem. |
|---|
| 55 | 56 | * Please visit the project's "home page", located at, |
|---|
| 56 | 57 | * 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 |
|---|
| 71 | 58 | */ |
|---|
| 72 | 59 | |
|---|
| 73 | 60 | #include <linux/jiffies.h> |
|---|
| .. | .. |
|---|
| 1726 | 1713 | |
|---|
| 1727 | 1714 | aiptek->inputdev = inputdev; |
|---|
| 1728 | 1715 | aiptek->intf = intf; |
|---|
| 1729 | | - aiptek->ifnum = intf->altsetting[0].desc.bInterfaceNumber; |
|---|
| 1716 | + aiptek->ifnum = intf->cur_altsetting->desc.bInterfaceNumber; |
|---|
| 1730 | 1717 | aiptek->inDelay = 0; |
|---|
| 1731 | 1718 | aiptek->endDelay = 0; |
|---|
| 1732 | 1719 | aiptek->previousJitterable = 0; |
|---|
| .. | .. |
|---|
| 1814 | 1801 | input_set_abs_params(inputdev, ABS_TILT_Y, AIPTEK_TILT_MIN, AIPTEK_TILT_MAX, 0, 0); |
|---|
| 1815 | 1802 | input_set_abs_params(inputdev, ABS_WHEEL, AIPTEK_WHEEL_MIN, AIPTEK_WHEEL_MAX - 1, 0, 0); |
|---|
| 1816 | 1803 | |
|---|
| 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) { |
|---|
| 1819 | 1807 | 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"); |
|---|
| 1823 | 1809 | goto fail3; |
|---|
| 1824 | 1810 | } |
|---|
| 1825 | | - endpoint = &intf->cur_altsetting->endpoint[0].desc; |
|---|
| 1826 | 1811 | |
|---|
| 1827 | 1812 | /* Go set up our URB, which is called when the tablet receives |
|---|
| 1828 | 1813 | * input. |
|---|