diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-05 10:26:01 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-05 10:26:01 -0700 |
commit | 1a3b85ea36d38d5732fdd86b321b10bcaeb53512 (patch) | |
tree | f3a7abeb6acaa47019e3d53b7ae75f7ae4361803 /drivers/usb/misc/ftdi-elan.c | |
parent | 04759194dc447ff0b9ef35bc641ce3bb076c2930 (diff) | |
parent | 46f5489f781ae3e4d23a4e8e29e0ea3626739d2d (diff) | |
download | linux-1a3b85ea36d38d5732fdd86b321b10bcaeb53512.tar.gz linux-1a3b85ea36d38d5732fdd86b321b10bcaeb53512.tar.xz |
Merge tag 'usb-4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB/PHY driver updates from Greg KH:
"Here is the large USB and PHY driver update for 4.14-rc1.
Not all that exciting, a few new PHY drivers, the usual mess of gadget
driver updates and fixes, and of course, xhci updates to try to tame
that beast.
A number of usb-serial updates and other small fixes all over the USB
driver tree are in here as well. Full details are in the shortlog.
All of these have been in linux-next for a while with no reported
issues"
* tag 'usb-4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (171 commits)
usbip: vhci-hcd: make vhci_hc_driver const
usb: phy: Avoid unchecked dereference warning
usb: imx21-hcd: make imx21_hc_driver const
usb: host: make ehci_fsl_overrides const and __initconst
dt-bindings: mt8173-mtu3: add generic compatible and rename file
dt-bindings: mt8173-xhci: add generic compatible and rename file
usb: xhci-mtk: add generic compatible string
usbip: auto retry for concurrent attach
USB: serial: option: simplify 3 D-Link device entries
USB: serial: option: add support for D-Link DWM-157 C1
usb: core: usbport: fix "BUG: key not in .data" when lockdep is enabled
usb: chipidea: usb2: check memory allocation failure
usb: Add device quirk for Logitech HD Pro Webcam C920-C
usb: misc: lvstest: add entry to place port in compliance mode
usb: xhci: Support enabling of compliance mode for xhci 1.1
usb:xhci:Fix regression when ATI chipsets detected
usb: quirks: add delay init quirk for Corsair Strafe RGB keyboard
usb: gadget: make snd_pcm_hardware const
usb: common: use of_property_read_bool()
USB: core: constify vm_operations_struct
...
Diffstat (limited to 'drivers/usb/misc/ftdi-elan.c')
-rw-r--r-- | drivers/usb/misc/ftdi-elan.c | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c index 8291499d0581..424ff12f3b51 100644 --- a/drivers/usb/misc/ftdi-elan.c +++ b/drivers/usb/misc/ftdi-elan.c @@ -305,9 +305,9 @@ static int ftdi_elan_command_engine(struct usb_ftdi *ftdi); static int ftdi_elan_respond_engine(struct usb_ftdi *ftdi); static int ftdi_elan_hcd_init(struct usb_ftdi *ftdi) { - int result; if (ftdi->platform_dev.dev.parent) return -EBUSY; + ftdi_elan_get_kref(ftdi); ftdi->platform_data.potpg = 100; ftdi->platform_data.reset = NULL; @@ -324,8 +324,8 @@ static int ftdi_elan_hcd_init(struct usb_ftdi *ftdi) request_module("u132_hcd"); dev_info(&ftdi->udev->dev, "registering '%s'\n", ftdi->platform_dev.name); - result = platform_device_register(&ftdi->platform_dev); - return result; + + return platform_device_register(&ftdi->platform_dev); } static void ftdi_elan_abandon_completions(struct usb_ftdi *ftdi) @@ -857,7 +857,7 @@ static char *have_ed_set_response(struct usb_ftdi *ftdi, target->actual = 0; target->non_null = (ed_length >> 15) & 0x0001; target->repeat_number = (ed_length >> 11) & 0x000F; - if (ed_type == 0x02) { + if (ed_type == 0x02 || ed_type == 0x03) { if (payload == 0 || target->abandoning > 0) { target->abandoning = 0; mutex_unlock(&ftdi->u132_lock); @@ -873,31 +873,6 @@ static char *have_ed_set_response(struct usb_ftdi *ftdi, mutex_unlock(&ftdi->u132_lock); return b; } - } else if (ed_type == 0x03) { - if (payload == 0 || target->abandoning > 0) { - target->abandoning = 0; - mutex_unlock(&ftdi->u132_lock); - ftdi_elan_do_callback(ftdi, target, 4 + ftdi->response, - payload); - ftdi->received = 0; - ftdi->expected = 4; - ftdi->ed_found = 0; - return ftdi->response; - } else { - ftdi->expected = 4 + payload; - ftdi->ed_found = 1; - mutex_unlock(&ftdi->u132_lock); - return b; - } - } else if (ed_type == 0x01) { - target->abandoning = 0; - mutex_unlock(&ftdi->u132_lock); - ftdi_elan_do_callback(ftdi, target, 4 + ftdi->response, - payload); - ftdi->received = 0; - ftdi->expected = 4; - ftdi->ed_found = 0; - return ftdi->response; } else { target->abandoning = 0; mutex_unlock(&ftdi->u132_lock); |