aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-05-17 00:15:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-05-17 00:15:59 -0400
commitc0655fe9b0901a968800f56687be3c62b4cce5d2 (patch)
tree5e2d7977d06b817150bd0eaef512907b3933a27a
parentdd8edd7e97bdc5d4b96e9f13c2fab3fdc6c9ca1f (diff)
parent569192605f56f384090be8c291a3f4a02402ad84 (diff)
Merge tag 'usb-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg KH: "Here are some USB fixes and new device ids for 4.1-rc4. All are pretty minor, and have been in linux-next successfully" * tag 'usb-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb-storage: Add NO_WP_DETECT quirk for Lacie 059f:0651 devices Added another USB product ID for ELAN touchscreen quirks. xhci: gracefully handle xhci_irq dead device xhci: Solve full event ring by increasing TRBS_PER_SEGMENT to 256 xhci: fix isoc endpoint dequeue from advancing too far on transaction error usb: chipidea: debug: avoid out of bound read USB: visor: Match I330 phone more precisely USB: pl2303: Remove support for Samsung I330 USB: cp210x: add ID for KCF Technologies PRN device usb: gadget: remove incorrect __init/__exit annotations usb: phy: isp1301: work around tps65010 dependency usb: gadget: serial: fix re-ordering of tx data usb: gadget: hid: Fix static variable usage usb: gadget: configfs: Fix interfaces array NULL-termination usb: gadget: xilinx: fix devm_ioremap_resource() check usb: dwc3: dwc3-omap: correct the register macros
-rw-r--r--drivers/usb/chipidea/debug.c6
-rw-r--r--drivers/usb/core/quirks.c3
-rw-r--r--drivers/usb/dwc3/dwc3-omap.c94
-rw-r--r--drivers/usb/gadget/configfs.c1
-rw-r--r--drivers/usb/gadget/function/f_hid.c16
-rw-r--r--drivers/usb/gadget/function/u_serial.c5
-rw-r--r--drivers/usb/gadget/legacy/acm_ms.c10
-rw-r--r--drivers/usb/gadget/legacy/audio.c10
-rw-r--r--drivers/usb/gadget/legacy/cdc2.c10
-rw-r--r--drivers/usb/gadget/legacy/dbgp.c4
-rw-r--r--drivers/usb/gadget/legacy/ether.c12
-rw-r--r--drivers/usb/gadget/legacy/g_ffs.c2
-rw-r--r--drivers/usb/gadget/legacy/gmidi.c10
-rw-r--r--drivers/usb/gadget/legacy/hid.c12
-rw-r--r--drivers/usb/gadget/legacy/mass_storage.c6
-rw-r--r--drivers/usb/gadget/legacy/multi.c10
-rw-r--r--drivers/usb/gadget/legacy/ncm.c10
-rw-r--r--drivers/usb/gadget/legacy/nokia.c10
-rw-r--r--drivers/usb/gadget/legacy/printer.c8
-rw-r--r--drivers/usb/gadget/legacy/serial.c4
-rw-r--r--drivers/usb/gadget/legacy/tcm_usb_gadget.c2
-rw-r--r--drivers/usb/gadget/legacy/webcam.c8
-rw-r--r--drivers/usb/gadget/legacy/zero.c4
-rw-r--r--drivers/usb/gadget/udc/at91_udc.c4
-rw-r--r--drivers/usb/gadget/udc/atmel_usba_udc.c4
-rw-r--r--drivers/usb/gadget/udc/fsl_udc_core.c4
-rw-r--r--drivers/usb/gadget/udc/fusb300_udc.c4
-rw-r--r--drivers/usb/gadget/udc/m66592-udc.c4
-rw-r--r--drivers/usb/gadget/udc/r8a66597-udc.c4
-rw-r--r--drivers/usb/gadget/udc/udc-xilinx.c4
-rw-r--r--drivers/usb/host/xhci-ring.c7
-rw-r--r--drivers/usb/host/xhci.h2
-rw-r--r--drivers/usb/phy/phy-isp1301-omap.c2
-rw-r--r--drivers/usb/serial/cp210x.c1
-rw-r--r--drivers/usb/serial/pl2303.c1
-rw-r--r--drivers/usb/serial/pl2303.h4
-rw-r--r--drivers/usb/serial/visor.c2
-rw-r--r--drivers/usb/storage/unusual_devs.h7
38 files changed, 171 insertions, 140 deletions
diff --git a/drivers/usb/chipidea/debug.c b/drivers/usb/chipidea/debug.c
index dfb05edcdb96..5b7061a33103 100644
--- a/drivers/usb/chipidea/debug.c
+++ b/drivers/usb/chipidea/debug.c
@@ -88,9 +88,13 @@ static ssize_t ci_port_test_write(struct file *file, const char __user *ubuf,
88 char buf[32]; 88 char buf[32];
89 int ret; 89 int ret;
90 90
91 if (copy_from_user(buf, ubuf, min_t(size_t, sizeof(buf) - 1, count))) 91 count = min_t(size_t, sizeof(buf) - 1, count);
92 if (copy_from_user(buf, ubuf, count))
92 return -EFAULT; 93 return -EFAULT;
93 94
95 /* sscanf requires a zero terminated string */
96 buf[count] = '\0';
97
94 if (sscanf(buf, "%u", &mode) != 1) 98 if (sscanf(buf, "%u", &mode) != 1)
95 return -EINVAL; 99 return -EINVAL;
96 100
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index 41e510ae8c83..d85abfed84cc 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -106,6 +106,9 @@ static const struct usb_device_id usb_quirk_list[] = {
106 { USB_DEVICE(0x04f3, 0x010c), .driver_info = 106 { USB_DEVICE(0x04f3, 0x010c), .driver_info =
107 USB_QUIRK_DEVICE_QUALIFIER }, 107 USB_QUIRK_DEVICE_QUALIFIER },
108 108
109 { USB_DEVICE(0x04f3, 0x0125), .driver_info =
110 USB_QUIRK_DEVICE_QUALIFIER },
111
109 { USB_DEVICE(0x04f3, 0x016f), .driver_info = 112 { USB_DEVICE(0x04f3, 0x016f), .driver_info =
110 USB_QUIRK_DEVICE_QUALIFIER }, 113 USB_QUIRK_DEVICE_QUALIFIER },
111 114
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index edba5348be18..6b486a36863c 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -65,8 +65,8 @@
65#define USBOTGSS_IRQENABLE_SET_MISC 0x003c 65#define USBOTGSS_IRQENABLE_SET_MISC 0x003c
66#define USBOTGSS_IRQENABLE_CLR_MISC 0x0040 66#define USBOTGSS_IRQENABLE_CLR_MISC 0x0040
67#define USBOTGSS_IRQMISC_OFFSET 0x03fc 67#define USBOTGSS_IRQMISC_OFFSET 0x03fc
68#define USBOTGSS_UTMI_OTG_CTRL 0x0080 68#define USBOTGSS_UTMI_OTG_STATUS 0x0080
69#define USBOTGSS_UTMI_OTG_STATUS 0x0084 69#define USBOTGSS_UTMI_OTG_CTRL 0x0084
70#define USBOTGSS_UTMI_OTG_OFFSET 0x0480 70#define USBOTGSS_UTMI_OTG_OFFSET 0x0480
71#define USBOTGSS_TXFIFO_DEPTH 0x0508 71#define USBOTGSS_TXFIFO_DEPTH 0x0508
72#define USBOTGSS_RXFIFO_DEPTH 0x050c 72#define USBOTGSS_RXFIFO_DEPTH 0x050c
@@ -98,20 +98,20 @@
98#define USBOTGSS_IRQMISC_DISCHRGVBUS_FALL (1 << 3) 98#define USBOTGSS_IRQMISC_DISCHRGVBUS_FALL (1 << 3)
99#define USBOTGSS_IRQMISC_IDPULLUP_FALL (1 << 0) 99#define USBOTGSS_IRQMISC_IDPULLUP_FALL (1 << 0)
100 100
101/* UTMI_OTG_CTRL REGISTER */
102#define USBOTGSS_UTMI_OTG_CTRL_DRVVBUS (1 << 5)
103#define USBOTGSS_UTMI_OTG_CTRL_CHRGVBUS (1 << 4)
104#define USBOTGSS_UTMI_OTG_CTRL_DISCHRGVBUS (1 << 3)
105#define USBOTGSS_UTMI_OTG_CTRL_IDPULLUP (1 << 0)
106
107/* UTMI_OTG_STATUS REGISTER */ 101/* UTMI_OTG_STATUS REGISTER */
108#define USBOTGSS_UTMI_OTG_STATUS_SW_MODE (1 << 31) 102#define USBOTGSS_UTMI_OTG_STATUS_DRVVBUS (1 << 5)
109#define USBOTGSS_UTMI_OTG_STATUS_POWERPRESENT (1 << 9) 103#define USBOTGSS_UTMI_OTG_STATUS_CHRGVBUS (1 << 4)
110#define USBOTGSS_UTMI_OTG_STATUS_TXBITSTUFFENABLE (1 << 8) 104#define USBOTGSS_UTMI_OTG_STATUS_DISCHRGVBUS (1 << 3)
111#define USBOTGSS_UTMI_OTG_STATUS_IDDIG (1 << 4) 105#define USBOTGSS_UTMI_OTG_STATUS_IDPULLUP (1 << 0)
112#define USBOTGSS_UTMI_OTG_STATUS_SESSEND (1 << 3) 106
113#define USBOTGSS_UTMI_OTG_STATUS_SESSVALID (1 << 2) 107/* UTMI_OTG_CTRL REGISTER */
114#define USBOTGSS_UTMI_OTG_STATUS_VBUSVALID (1 << 1) 108#define USBOTGSS_UTMI_OTG_CTRL_SW_MODE (1 << 31)
109#define USBOTGSS_UTMI_OTG_CTRL_POWERPRESENT (1 << 9)
110#define USBOTGSS_UTMI_OTG_CTRL_TXBITSTUFFENABLE (1 << 8)
111#define USBOTGSS_UTMI_OTG_CTRL_IDDIG (1 << 4)
112#define USBOTGSS_UTMI_OTG_CTRL_SESSEND (1 << 3)
113#define USBOTGSS_UTMI_OTG_CTRL_SESSVALID (1 << 2)
114#define USBOTGSS_UTMI_OTG_CTRL_VBUSVALID (1 << 1)
115 115
116struct dwc3_omap { 116struct dwc3_omap {
117 struct device *dev; 117 struct device *dev;
@@ -119,7 +119,7 @@ struct dwc3_omap {
119 int irq; 119 int irq;
120 void __iomem *base; 120 void __iomem *base;
121 121
122 u32 utmi_otg_status; 122 u32 utmi_otg_ctrl;
123 u32 utmi_otg_offset; 123 u32 utmi_otg_offset;
124 u32 irqmisc_offset; 124 u32 irqmisc_offset;
125 u32 irq_eoi_offset; 125 u32 irq_eoi_offset;
@@ -153,15 +153,15 @@ static inline void dwc3_omap_writel(void __iomem *base, u32 offset, u32 value)
153 writel(value, base + offset); 153 writel(value, base + offset);
154} 154}
155 155
156static u32 dwc3_omap_read_utmi_status(struct dwc3_omap *omap) 156static u32 dwc3_omap_read_utmi_ctrl(struct dwc3_omap *omap)
157{ 157{
158 return dwc3_omap_readl(omap->base, USBOTGSS_UTMI_OTG_STATUS + 158 return dwc3_omap_readl(omap->base, USBOTGSS_UTMI_OTG_CTRL +
159 omap->utmi_otg_offset); 159 omap->utmi_otg_offset);
160} 160}
161 161
162static void dwc3_omap_write_utmi_status(struct dwc3_omap *omap, u32 value) 162static void dwc3_omap_write_utmi_ctrl(struct dwc3_omap *omap, u32 value)
163{ 163{
164 dwc3_omap_writel(omap->base, USBOTGSS_UTMI_OTG_STATUS + 164 dwc3_omap_writel(omap->base, USBOTGSS_UTMI_OTG_CTRL +
165 omap->utmi_otg_offset, value); 165 omap->utmi_otg_offset, value);
166 166
167} 167}
@@ -235,25 +235,25 @@ static void dwc3_omap_set_mailbox(struct dwc3_omap *omap,
235 } 235 }
236 } 236 }
237 237
238 val = dwc3_omap_read_utmi_status(omap); 238 val = dwc3_omap_read_utmi_ctrl(omap);
239 val &= ~(USBOTGSS_UTMI_OTG_STATUS_IDDIG 239 val &= ~(USBOTGSS_UTMI_OTG_CTRL_IDDIG
240 | USBOTGSS_UTMI_OTG_STATUS_VBUSVALID 240 | USBOTGSS_UTMI_OTG_CTRL_VBUSVALID
241 | USBOTGSS_UTMI_OTG_STATUS_SESSEND); 241 | USBOTGSS_UTMI_OTG_CTRL_SESSEND);
242 val |= USBOTGSS_UTMI_OTG_STATUS_SESSVALID 242 val |= USBOTGSS_UTMI_OTG_CTRL_SESSVALID
243 | USBOTGSS_UTMI_OTG_STATUS_POWERPRESENT; 243 | USBOTGSS_UTMI_OTG_CTRL_POWERPRESENT;
244 dwc3_omap_write_utmi_status(omap, val); 244 dwc3_omap_write_utmi_ctrl(omap, val);
245 break; 245 break;
246 246
247 case OMAP_DWC3_VBUS_VALID: 247 case OMAP_DWC3_VBUS_VALID:
248 dev_dbg(omap->dev, "VBUS Connect\n"); 248 dev_dbg(omap->dev, "VBUS Connect\n");
249 249
250 val = dwc3_omap_read_utmi_status(omap); 250 val = dwc3_omap_read_utmi_ctrl(omap);
251 val &= ~USBOTGSS_UTMI_OTG_STATUS_SESSEND; 251 val &= ~USBOTGSS_UTMI_OTG_CTRL_SESSEND;
252 val |= USBOTGSS_UTMI_OTG_STATUS_IDDIG 252 val |= USBOTGSS_UTMI_OTG_CTRL_IDDIG
253 | USBOTGSS_UTMI_OTG_STATUS_VBUSVALID 253 | USBOTGSS_UTMI_OTG_CTRL_VBUSVALID
254 | USBOTGSS_UTMI_OTG_STATUS_SESSVALID 254 | USBOTGSS_UTMI_OTG_CTRL_SESSVALID
255 | USBOTGSS_UTMI_OTG_STATUS_POWERPRESENT; 255 | USBOTGSS_UTMI_OTG_CTRL_POWERPRESENT;
256 dwc3_omap_write_utmi_status(omap, val); 256 dwc3_omap_write_utmi_ctrl(omap, val);
257 break; 257 break;
258 258
259 case OMAP_DWC3_ID_FLOAT: 259 case OMAP_DWC3_ID_FLOAT:
@@ -263,13 +263,13 @@ static void dwc3_omap_set_mailbox(struct dwc3_omap *omap,
263 case OMAP_DWC3_VBUS_OFF: 263 case OMAP_DWC3_VBUS_OFF:
264 dev_dbg(omap->dev, "VBUS Disconnect\n"); 264 dev_dbg(omap->dev, "VBUS Disconnect\n");
265 265
266 val = dwc3_omap_read_utmi_status(omap); 266 val = dwc3_omap_read_utmi_ctrl(omap);
267 val &= ~(USBOTGSS_UTMI_OTG_STATUS_SESSVALID 267 val &= ~(USBOTGSS_UTMI_OTG_CTRL_SESSVALID
268 | USBOTGSS_UTMI_OTG_STATUS_VBUSVALID 268 | USBOTGSS_UTMI_OTG_CTRL_VBUSVALID
269 | USBOTGSS_UTMI_OTG_STATUS_POWERPRESENT); 269 | USBOTGSS_UTMI_OTG_CTRL_POWERPRESENT);
270 val |= USBOTGSS_UTMI_OTG_STATUS_SESSEND 270 val |= USBOTGSS_UTMI_OTG_CTRL_SESSEND
271 | USBOTGSS_UTMI_OTG_STATUS_IDDIG; 271 | USBOTGSS_UTMI_OTG_CTRL_IDDIG;
272 dwc3_omap_write_utmi_status(omap, val); 272 dwc3_omap_write_utmi_ctrl(omap, val);
273 break; 273 break;
274 274
275 default: 275 default:
@@ -422,22 +422,22 @@ static void dwc3_omap_set_utmi_mode(struct dwc3_omap *omap)
422 struct device_node *node = omap->dev->of_node; 422 struct device_node *node = omap->dev->of_node;
423 int utmi_mode = 0; 423 int utmi_mode = 0;
424 424
425 reg = dwc3_omap_read_utmi_status(omap); 425 reg = dwc3_omap_read_utmi_ctrl(omap);
426 426
427 of_property_read_u32(node, "utmi-mode", &utmi_mode); 427 of_property_read_u32(node, "utmi-mode", &utmi_mode);
428 428
429 switch (utmi_mode) { 429 switch (utmi_mode) {
430 case DWC3_OMAP_UTMI_MODE_SW: 430 case DWC3_OMAP_UTMI_MODE_SW:
431 reg |= USBOTGSS_UTMI_OTG_STATUS_SW_MODE; 431 reg |= USBOTGSS_UTMI_OTG_CTRL_SW_MODE;
432 break; 432 break;
433 case DWC3_OMAP_UTMI_MODE_HW: 433 case DWC3_OMAP_UTMI_MODE_HW:
434 reg &= ~USBOTGSS_UTMI_OTG_STATUS_SW_MODE; 434 reg &= ~USBOTGSS_UTMI_OTG_CTRL_SW_MODE;
435 break; 435 break;
436 default: 436 default:
437 dev_dbg(omap->dev, "UNKNOWN utmi mode %d\n", utmi_mode); 437 dev_dbg(omap->dev, "UNKNOWN utmi mode %d\n", utmi_mode);
438 } 438 }
439 439
440 dwc3_omap_write_utmi_status(omap, reg); 440 dwc3_omap_write_utmi_ctrl(omap, reg);
441} 441}
442 442
443static int dwc3_omap_extcon_register(struct dwc3_omap *omap) 443static int dwc3_omap_extcon_register(struct dwc3_omap *omap)
@@ -614,7 +614,7 @@ static int dwc3_omap_suspend(struct device *dev)
614{ 614{
615 struct dwc3_omap *omap = dev_get_drvdata(dev); 615 struct dwc3_omap *omap = dev_get_drvdata(dev);
616 616
617 omap->utmi_otg_status = dwc3_omap_read_utmi_status(omap); 617 omap->utmi_otg_ctrl = dwc3_omap_read_utmi_ctrl(omap);
618 dwc3_omap_disable_irqs(omap); 618 dwc3_omap_disable_irqs(omap);
619 619
620 return 0; 620 return 0;
@@ -624,7 +624,7 @@ static int dwc3_omap_resume(struct device *dev)
624{ 624{
625 struct dwc3_omap *omap = dev_get_drvdata(dev); 625 struct dwc3_omap *omap = dev_get_drvdata(dev);
626 626
627 dwc3_omap_write_utmi_status(omap, omap->utmi_otg_status); 627 dwc3_omap_write_utmi_ctrl(omap, omap->utmi_otg_ctrl);
628 dwc3_omap_enable_irqs(omap); 628 dwc3_omap_enable_irqs(omap);
629 629
630 pm_runtime_disable(dev); 630 pm_runtime_disable(dev);
diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
index c42765b3a060..0495c94a23d7 100644
--- a/drivers/usb/gadget/configfs.c
+++ b/drivers/usb/gadget/configfs.c
@@ -1295,6 +1295,7 @@ static void purge_configs_funcs(struct gadget_info *gi)
1295 } 1295 }
1296 } 1296 }
1297 c->next_interface_id = 0; 1297 c->next_interface_id = 0;
1298 memset(c->interface, 0, sizeof(c->interface));
1298 c->superspeed = 0; 1299 c->superspeed = 0;
1299 c->highspeed = 0; 1300 c->highspeed = 0;
1300 c->fullspeed = 0; 1301 c->fullspeed = 0;
diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c
index 13dfc9915b1d..f7f35a36c09a 100644
--- a/drivers/usb/gadget/function/f_hid.c
+++ b/drivers/usb/gadget/function/f_hid.c
@@ -437,12 +437,20 @@ static int hidg_setup(struct usb_function *f,
437 | USB_REQ_GET_DESCRIPTOR): 437 | USB_REQ_GET_DESCRIPTOR):
438 switch (value >> 8) { 438 switch (value >> 8) {
439 case HID_DT_HID: 439 case HID_DT_HID:
440 {
441 struct hid_descriptor hidg_desc_copy = hidg_desc;
442
440 VDBG(cdev, "USB_REQ_GET_DESCRIPTOR: HID\n"); 443 VDBG(cdev, "USB_REQ_GET_DESCRIPTOR: HID\n");
444 hidg_desc_copy.desc[0].bDescriptorType = HID_DT_REPORT;
445 hidg_desc_copy.desc[0].wDescriptorLength =
446 cpu_to_le16(hidg->report_desc_length);
447
441 length = min_t(unsigned short, length, 448 length = min_t(unsigned short, length,
442 hidg_desc.bLength); 449 hidg_desc_copy.bLength);
443 memcpy(req->buf, &hidg_desc, length); 450 memcpy(req->buf, &hidg_desc_copy, length);
444 goto respond; 451 goto respond;
445 break; 452 break;
453 }
446 case HID_DT_REPORT: 454 case HID_DT_REPORT:
447 VDBG(cdev, "USB_REQ_GET_DESCRIPTOR: REPORT\n"); 455 VDBG(cdev, "USB_REQ_GET_DESCRIPTOR: REPORT\n");
448 length = min_t(unsigned short, length, 456 length = min_t(unsigned short, length,
@@ -632,6 +640,10 @@ static int hidg_bind(struct usb_configuration *c, struct usb_function *f)
632 hidg_fs_in_ep_desc.wMaxPacketSize = cpu_to_le16(hidg->report_length); 640 hidg_fs_in_ep_desc.wMaxPacketSize = cpu_to_le16(hidg->report_length);
633 hidg_hs_out_ep_desc.wMaxPacketSize = cpu_to_le16(hidg->report_length); 641 hidg_hs_out_ep_desc.wMaxPacketSize = cpu_to_le16(hidg->report_length);
634 hidg_fs_out_ep_desc.wMaxPacketSize = cpu_to_le16(hidg->report_length); 642 hidg_fs_out_ep_desc.wMaxPacketSize = cpu_to_le16(hidg->report_length);
643 /*
644 * We can use hidg_desc struct here but we should not relay
645 * that its content won't change after returning from this function.
646 */
635 hidg_desc.desc[0].bDescriptorType = HID_DT_REPORT; 647 hidg_desc.desc[0].bDescriptorType = HID_DT_REPORT;
636 hidg_desc.desc[0].wDescriptorLength = 648 hidg_desc.desc[0].wDescriptorLength =
637 cpu_to_le16(hidg->report_desc_length); 649 cpu_to_le16(hidg->report_desc_length);
diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c
index 89179ab20c10..7ee057930ae7 100644
--- a/drivers/usb/gadget/function/u_serial.c
+++ b/drivers/usb/gadget/function/u_serial.c
@@ -113,6 +113,7 @@ struct gs_port {
113 int write_allocated; 113 int write_allocated;
114 struct gs_buf port_write_buf; 114 struct gs_buf port_write_buf;
115 wait_queue_head_t drain_wait; /* wait while writes drain */ 115 wait_queue_head_t drain_wait; /* wait while writes drain */
116 bool write_busy;
116 117
117 /* REVISIT this state ... */ 118 /* REVISIT this state ... */
118 struct usb_cdc_line_coding port_line_coding; /* 8-N-1 etc */ 119 struct usb_cdc_line_coding port_line_coding; /* 8-N-1 etc */
@@ -363,7 +364,7 @@ __acquires(&port->port_lock)
363 int status = 0; 364 int status = 0;
364 bool do_tty_wake = false; 365 bool do_tty_wake = false;
365 366
366 while (!list_empty(pool)) { 367 while (!port->write_busy && !list_empty(pool)) {
367 struct usb_request *req; 368 struct usb_request *req;
368 int len; 369 int len;
369 370
@@ -393,9 +394,11 @@ __acquires(&port->port_lock)
393 * NOTE that we may keep sending data for a while after 394 * NOTE that we may keep sending data for a while after
394 * the TTY closed (dev->ioport->port_tty is NULL). 395 * the TTY closed (dev->ioport->port_tty is NULL).
395 */ 396 */
397 port->write_busy = true;
396 spin_unlock(&port->port_lock); 398 spin_unlock(&port->port_lock);
397 status = usb_ep_queue(in, req, GFP_ATOMIC); 399 status = usb_ep_queue(in, req, GFP_ATOMIC);
398 spin_lock(&port->port_lock); 400 spin_lock(&port->port_lock);
401 port->write_busy = false;
399 402
400 if (status) { 403 if (status) {
401 pr_debug("%s: %s %s err %d\n", 404 pr_debug("%s: %s %s err %d\n",
diff --git a/drivers/usb/gadget/legacy/acm_ms.c b/drivers/usb/gadget/legacy/acm_ms.c
index c30b7b572465..1194b09ae746 100644
--- a/drivers/usb/gadget/legacy/acm_ms.c
+++ b/drivers/usb/gadget/legacy/acm_ms.c
@@ -121,7 +121,7 @@ static struct usb_function *f_msg;
121/* 121/*
122 * We _always_ have both ACM and mass storage functions. 122 * We _always_ have both ACM and mass storage functions.
123 */ 123 */
124static int __init acm_ms_do_config(struct usb_configuration *c) 124static int acm_ms_do_config(struct usb_configuration *c)
125{ 125{
126 struct fsg_opts *opts; 126 struct fsg_opts *opts;
127 int status; 127 int status;
@@ -174,7 +174,7 @@ static struct usb_configuration acm_ms_config_driver = {
174 174
175/*-------------------------------------------------------------------------*/ 175/*-------------------------------------------------------------------------*/
176 176
177static int __init acm_ms_bind(struct usb_composite_dev *cdev) 177static int acm_ms_bind(struct usb_composite_dev *cdev)
178{ 178{
179 struct usb_gadget *gadget = cdev->gadget; 179 struct usb_gadget *gadget = cdev->gadget;
180 struct fsg_opts *opts; 180 struct fsg_opts *opts;
@@ -249,7 +249,7 @@ fail_get_msg:
249 return status; 249 return status;
250} 250}
251 251
252static int __exit acm_ms_unbind(struct usb_composite_dev *cdev) 252static int acm_ms_unbind(struct usb_composite_dev *cdev)
253{ 253{
254 usb_put_function(f_msg); 254 usb_put_function(f_msg);
255 usb_put_function_instance(fi_msg); 255 usb_put_function_instance(fi_msg);
@@ -258,13 +258,13 @@ static int __exit acm_ms_unbind(struct usb_composite_dev *cdev)
258 return 0; 258 return 0;
259} 259}
260 260
261static __refdata struct usb_composite_driver acm_ms_driver = { 261static struct usb_composite_driver acm_ms_driver = {
262 .name = "g_acm_ms", 262 .name = "g_acm_ms",
263 .dev = &device_desc, 263 .dev = &device_desc,
264 .max_speed = USB_SPEED_SUPER, 264 .max_speed = USB_SPEED_SUPER,
265 .strings = dev_strings, 265 .strings = dev_strings,
266 .bind = acm_ms_bind, 266 .bind = acm_ms_bind,
267 .unbind = __exit_p(acm_ms_unbind), 267 .unbind = acm_ms_unbind,
268}; 268};
269 269
270module_usb_composite_driver(acm_ms_driver); 270module_usb_composite_driver(acm_ms_driver);
diff --git a/drivers/usb/gadget/legacy/audio.c b/drivers/usb/gadget/legacy/audio.c
index f46a3956e43d..f289caf18a45 100644
--- a/drivers/usb/gadget/legacy/audio.c
+++ b/drivers/usb/gadget/legacy/audio.c
@@ -167,7 +167,7 @@ static const struct usb_descriptor_header *otg_desc[] = {
167 167
168/*-------------------------------------------------------------------------*/ 168/*-------------------------------------------------------------------------*/
169 169
170static int __init audio_do_config(struct usb_configuration *c) 170static int audio_do_config(struct usb_configuration *c)
171{ 171{
172 int status; 172 int status;
173 173
@@ -216,7 +216,7 @@ static struct usb_configuration audio_config_driver = {
216 216
217/*-------------------------------------------------------------------------*/ 217/*-------------------------------------------------------------------------*/
218 218
219static int __init audio_bind(struct usb_composite_dev *cdev) 219static int audio_bind(struct usb_composite_dev *cdev)
220{ 220{
221#ifndef CONFIG_GADGET_UAC1 221#ifndef CONFIG_GADGET_UAC1
222 struct f_uac2_opts *uac2_opts; 222 struct f_uac2_opts *uac2_opts;
@@ -276,7 +276,7 @@ fail:
276 return status; 276 return status;
277} 277}
278 278
279static int __exit audio_unbind(struct usb_composite_dev *cdev) 279static int audio_unbind(struct usb_composite_dev *cdev)
280{ 280{
281#ifdef CONFIG_GADGET_UAC1 281#ifdef CONFIG_GADGET_UAC1
282 if (!IS_ERR_OR_NULL(f_uac1)) 282 if (!IS_ERR_OR_NULL(f_uac1))
@@ -292,13 +292,13 @@ static int __exit audio_unbind(struct usb_composite_dev *cdev)
292 return 0; 292 return 0;
293} 293}
294 294
295static __refdata struct usb_composite_driver audio_driver = { 295static struct usb_composite_driver audio_driver = {
296 .name = "g_audio", 296 .name = "g_audio",
297 .dev = &device_desc, 297 .dev = &device_desc,
298 .strings = audio_strings, 298 .strings = audio_strings,
299 .max_speed = USB_SPEED_HIGH, 299 .max_speed = USB_SPEED_HIGH,
300 .bind = audio_bind, 300 .bind = audio_bind,
301 .unbind = __exit_p(audio_unbind), 301 .unbind = audio_unbind,
302}; 302};
303 303
304module_usb_composite_driver(audio_driver); 304module_usb_composite_driver(audio_driver);
diff --git a/drivers/usb/gadget/legacy/cdc2.c b/drivers/usb/gadget/legacy/cdc2.c
index 2e85d9473478..afd3e37921a7 100644
--- a/drivers/usb/gadget/legacy/cdc2.c
+++ b/drivers/usb/gadget/legacy/cdc2.c
@@ -104,7 +104,7 @@ static struct usb_function_instance *fi_ecm;
104/* 104/*
105 * We _always_ have both CDC ECM and CDC ACM functions. 105 * We _always_ have both CDC ECM and CDC ACM functions.
106 */ 106 */
107static int __init cdc_do_config(struct usb_configuration *c) 107static int cdc_do_config(struct usb_configuration *c)
108{ 108{
109 int status; 109 int status;
110 110
@@ -153,7 +153,7 @@ static struct usb_configuration cdc_config_driver = {
153 153
154/*-------------------------------------------------------------------------*/ 154/*-------------------------------------------------------------------------*/
155 155
156static int __init cdc_bind(struct usb_composite_dev *cdev) 156static int cdc_bind(struct usb_composite_dev *cdev)
157{ 157{
158 struct usb_gadget *gadget = cdev->gadget; 158 struct usb_gadget *gadget = cdev->gadget;
159 struct f_ecm_opts *ecm_opts; 159 struct f_ecm_opts *ecm_opts;
@@ -211,7 +211,7 @@ fail:
211 return status; 211 return status;
212} 212}
213 213
214static int __exit cdc_unbind(struct usb_composite_dev *cdev) 214static int cdc_unbind(struct usb_composite_dev *cdev)
215{ 215{
216 usb_put_function(f_acm); 216 usb_put_function(f_acm);
217 usb_put_function_instance(fi_serial); 217 usb_put_function_instance(fi_serial);
@@ -222,13 +222,13 @@ static int __exit cdc_unbind(struct usb_composite_dev *cdev)
222 return 0; 222 return 0;
223} 223}
224 224
225static __refdata struct usb_composite_driver cdc_driver = { 225static struct usb_composite_driver cdc_driver = {
226 .name = "g_cdc", 226 .name = "g_cdc",
227 .dev = &device_desc, 227 .dev = &device_desc,
228 .strings = dev_strings, 228 .strings = dev_strings,
229 .max_speed = USB_SPEED_HIGH, 229 .max_speed = USB_SPEED_HIGH,
230 .bind = cdc_bind, 230 .bind = cdc_bind,
231 .unbind = __exit_p(cdc_unbind), 231 .unbind = cdc_unbind,
232}; 232};
233 233
234module_usb_composite_driver(cdc_driver); 234module_usb_composite_driver(cdc_driver);
diff --git a/drivers/usb/gadget/legacy/dbgp.c b/drivers/usb/gadget/legacy/dbgp.c
index 633683a72a11..204b10b1a7e7 100644
--- a/drivers/usb/gadget/legacy/dbgp.c
+++ b/drivers/usb/gadget/legacy/dbgp.c
@@ -284,7 +284,7 @@ fail_1:
284 return -ENODEV; 284 return -ENODEV;
285} 285}
286 286
287static int __init dbgp_bind(struct usb_gadget *gadget, 287static int dbgp_bind(struct usb_gadget *gadget,
288 struct usb_gadget_driver *driver) 288 struct usb_gadget_driver *driver)
289{ 289{
290 int err, stp; 290 int err, stp;
@@ -406,7 +406,7 @@ fail:
406 return err; 406 return err;
407} 407}
408 408
409static __refdata struct usb_gadget_driver dbgp_driver = { 409static struct usb_gadget_driver dbgp_driver = {
410 .function = "dbgp", 410 .function = "dbgp",
411 .max_speed = USB_SPEED_HIGH, 411 .max_speed = USB_SPEED_HIGH,
412 .bind = dbgp_bind, 412 .bind = dbgp_bind,
diff --git a/drivers/usb/gadget/legacy/ether.c b/drivers/usb/gadget/legacy/ether.c
index c5fdc61cdc4a..a3323dca218f 100644
--- a/drivers/usb/gadget/legacy/ether.c
+++ b/drivers/usb/gadget/legacy/ether.c
@@ -222,7 +222,7 @@ static struct usb_function *f_rndis;
222 * the first one present. That's to make Microsoft's drivers happy, 222 * the first one present. That's to make Microsoft's drivers happy,
223 * and to follow DOCSIS 1.0 (cable modem standard). 223 * and to follow DOCSIS 1.0 (cable modem standard).
224 */ 224 */
225static int __init rndis_do_config(struct usb_configuration *c) 225static int rndis_do_config(struct usb_configuration *c)
226{ 226{
227 int status; 227 int status;
228 228
@@ -264,7 +264,7 @@ MODULE_PARM_DESC(use_eem, "use CDC EEM mode");
264/* 264/*
265 * We _always_ have an ECM, CDC Subset, or EEM configuration. 265 * We _always_ have an ECM, CDC Subset, or EEM configuration.
266 */ 266 */
267static int __init eth_do_config(struct usb_configuration *c) 267static int eth_do_config(struct usb_configuration *c)
268{ 268{
269 int status = 0; 269 int status = 0;
270 270
@@ -318,7 +318,7 @@ static struct usb_configuration eth_config_driver = {
318 318
319/*-------------------------------------------------------------------------*/ 319/*-------------------------------------------------------------------------*/
320 320
321static int __init eth_bind(struct usb_composite_dev *cdev) 321static int eth_bind(struct usb_composite_dev *cdev)
322{ 322{
323 struct usb_gadget *gadget = cdev->gadget; 323 struct usb_gadget *gadget = cdev->gadget;
324 struct f_eem_opts *eem_opts = NULL; 324 struct f_eem_opts *eem_opts = NULL;
@@ -447,7 +447,7 @@ fail:
447 return status; 447 return status;
448} 448}
449 449
450static int __exit eth_unbind(struct usb_composite_dev *cdev) 450static int eth_unbind(struct usb_composite_dev *cdev)
451{ 451{
452 if (has_rndis()) { 452 if (has_rndis()) {
453 usb_put_function(f_rndis); 453 usb_put_function(f_rndis);
@@ -466,13 +466,13 @@ static int __exit eth_unbind(struct usb_composite_dev *cdev)
466 return 0; 466 return 0;
467} 467}
468 468
469static __refdata struct usb_composite_driver eth_driver = { 469static struct usb_composite_driver eth_driver = {
470 .name = "g_ether", 470 .name = "g_ether",
471 .dev = &device_desc, 471 .dev = &device_desc,
472 .strings = dev_strings, 472 .strings = dev_strings,
473 .max_speed = USB_SPEED_SUPER, 473 .max_speed = USB_SPEED_SUPER,
474 .bind = eth_bind, 474 .bind = eth_bind,
475 .unbind = __exit_p(eth_unbind), 475 .unbind = eth_unbind,
476}; 476};
477 477
478module_usb_composite_driver(eth_driver); 478module_usb_composite_driver(eth_driver);
diff --git a/drivers/usb/gadget/legacy/g_ffs.c b/drivers/usb/gadget/legacy/g_ffs.c
index b01b88e1b716..7b9ef7e257d2 100644
--- a/drivers/usb/gadget/legacy/g_ffs.c
+++ b/drivers/usb/gadget/legacy/g_ffs.c
@@ -163,7 +163,7 @@ static int gfs_unbind(struct usb_composite_dev *cdev);
163static int gfs_do_config(struct usb_configuration *c); 163static int gfs_do_config(struct usb_configuration *c);
164 164
165 165
166static __refdata struct usb_composite_driver gfs_driver = { 166static struct usb_composite_driver gfs_driver = {
167 .name = DRIVER_NAME, 167 .name = DRIVER_NAME,
168 .dev = &gfs_dev_desc, 168 .dev = &gfs_dev_desc,
169 .strings = gfs_dev_strings, 169 .strings = gfs_dev_strings,
diff --git a/drivers/usb/gadget/legacy/gmidi.c b/drivers/usb/gadget/legacy/gmidi.c
index e02a095294ac..da19c486b61e 100644
--- a/drivers/usb/gadget/legacy/gmidi.c
+++ b/drivers/usb/gadget/legacy/gmidi.c
@@ -118,7 +118,7 @@ static struct usb_gadget_strings *dev_strings[] = {
118static struct usb_function_instance *fi_midi; 118static struct usb_function_instance *fi_midi;
119static struct usb_function *f_midi; 119static struct usb_function *f_midi;
120 120
121static int __exit midi_unbind(struct usb_composite_dev *dev) 121static int midi_unbind(struct usb_composite_dev *dev)
122{ 122{
123 usb_put_function(f_midi); 123 usb_put_function(f_midi);
124 usb_put_function_instance(fi_midi); 124 usb_put_function_instance(fi_midi);
@@ -133,7 +133,7 @@ static struct usb_configuration midi_config = {
133 .MaxPower = CONFIG_USB_GADGET_VBUS_DRAW, 133 .MaxPower = CONFIG_USB_GADGET_VBUS_DRAW,
134}; 134};
135 135
136static int __init midi_bind_config(struct usb_configuration *c) 136static int midi_bind_config(struct usb_configuration *c)
137{ 137{
138 int status; 138 int status;
139 139
@@ -150,7 +150,7 @@ static int __init midi_bind_config(struct usb_configuration *c)
150 return 0; 150 return 0;
151} 151}
152 152
153static int __init midi_bind(struct usb_composite_dev *cdev) 153static int midi_bind(struct usb_composite_dev *cdev)
154{ 154{
155 struct f_midi_opts *midi_opts; 155 struct f_midi_opts *midi_opts;
156 int status; 156 int status;
@@ -185,13 +185,13 @@ put:
185 return status; 185 return status;
186} 186}
187 187
188static __refdata struct usb_composite_driver midi_driver = { 188static struct usb_composite_driver midi_driver = {
189 .name = (char *) longname, 189 .name = (char *) longname,
190 .dev = &device_desc, 190 .dev = &device_desc,
191 .strings = dev_strings, 191 .strings = dev_strings,
192 .max_speed = USB_SPEED_HIGH, 192 .max_speed = USB_SPEED_HIGH,
193 .bind = midi_bind, 193 .bind = midi_bind,
194 .unbind = __exit_p(midi_unbind), 194 .unbind = midi_unbind,
195}; 195};
196 196
197module_usb_composite_driver(midi_driver); 197module_usb_composite_driver(midi_driver);
diff --git a/drivers/usb/gadget/legacy/hid.c b/drivers/usb/gadget/legacy/hid.c
index 614b06d80b41..2baa572686c6 100644
--- a/drivers/usb/gadget/legacy/hid.c
+++ b/drivers/usb/gadget/legacy/hid.c
@@ -106,7 +106,7 @@ static struct usb_gadget_strings *dev_strings[] = {
106 106
107/****************************** Configurations ******************************/ 107/****************************** Configurations ******************************/
108 108
109static int __init do_config(struct usb_configuration *c) 109static int do_config(struct usb_configuration *c)
110{ 110{
111 struct hidg_func_node *e, *n; 111 struct hidg_func_node *e, *n;
112 int status = 0; 112 int status = 0;
@@ -147,7 +147,7 @@ static struct usb_configuration config_driver = {
147 147
148/****************************** Gadget Bind ******************************/ 148/****************************** Gadget Bind ******************************/
149 149
150static int __init hid_bind(struct usb_composite_dev *cdev) 150static int hid_bind(struct usb_composite_dev *cdev)
151{ 151{
152 struct usb_gadget *gadget = cdev->gadget; 152 struct usb_gadget *gadget = cdev->gadget;
153 struct list_head *tmp; 153 struct list_head *tmp;
@@ -205,7 +205,7 @@ put:
205 return status; 205 return status;
206} 206}
207 207
208static int __exit hid_unbind(struct usb_composite_dev *cdev) 208static int hid_unbind(struct usb_composite_dev *cdev)
209{ 209{
210 struct hidg_func_node *n; 210 struct hidg_func_node *n;
211 211
@@ -216,7 +216,7 @@ static int __exit hid_unbind(struct usb_composite_dev *cdev)
216 return 0; 216 return 0;
217} 217}
218 218
219static int __init hidg_plat_driver_probe(struct platform_device *pdev) 219static int hidg_plat_driver_probe(struct platform_device *pdev)
220{ 220{
221 struct hidg_func_descriptor *func = dev_get_platdata(&pdev->dev); 221 struct hidg_func_descriptor *func = dev_get_platdata(&pdev->dev);
222 struct hidg_func_node *entry; 222 struct hidg_func_node *entry;
@@ -252,13 +252,13 @@ static int hidg_plat_driver_remove(struct platform_device *pdev)
252/****************************** Some noise ******************************/ 252/****************************** Some noise ******************************/
253 253
254 254
255static __refdata struct usb_composite_driver hidg_driver = { 255static struct usb_composite_driver hidg_driver = {
256 .name = "g_hid", 256 .name = "g_hid",
257 .dev = &device_desc, 257 .dev = &device_desc,
258 .strings = dev_strings, 258 .strings = dev_strings,
259 .max_speed = USB_SPEED_HIGH, 259 .max_speed = USB_SPEED_HIGH,
260 .bind = hid_bind, 260 .bind = hid_bind,
261 .unbind = __exit_p(hid_unbind), 261 .unbind = hid_unbind,
262}; 262};
263 263
264static struct platform_driver hidg_plat_driver = { 264static struct platform_driver hidg_plat_driver = {
diff --git a/drivers/usb/gadget/legacy/mass_storage.c b/drivers/usb/gadget/legacy/mass_storage.c
index 8e27a8c96444..e7bfb081f111 100644
--- a/drivers/usb/gadget/legacy/mass_storage.c
+++ b/drivers/usb/gadget/legacy/mass_storage.c
@@ -130,7 +130,7 @@ static int msg_thread_exits(struct fsg_common *common)
130 return 0; 130 return 0;
131} 131}
132 132
133static int __init msg_do_config(struct usb_configuration *c) 133static int msg_do_config(struct usb_configuration *c)
134{ 134{
135 struct fsg_opts *opts; 135 struct fsg_opts *opts;
136 int ret; 136 int ret;
@@ -170,7 +170,7 @@ static struct usb_configuration msg_config_driver = {
170 170
171/****************************** Gadget Bind ******************************/ 171/****************************** Gadget Bind ******************************/
172 172
173static int __init msg_bind(struct usb_composite_dev *cdev) 173static int msg_bind(struct usb_composite_dev *cdev)
174{ 174{
175 static const struct fsg_operations ops = { 175 static const struct fsg_operations ops = {
176 .thread_exits = msg_thread_exits, 176 .thread_exits = msg_thread_exits,
@@ -248,7 +248,7 @@ static int msg_unbind(struct usb_composite_dev *cdev)
248 248
249/****************************** Some noise ******************************/ 249/****************************** Some noise ******************************/
250 250
251static __refdata struct usb_composite_driver msg_driver = { 251static struct usb_composite_driver msg_driver = {
252 .name = "g_mass_storage", 252 .name = "g_mass_storage",
253 .dev = &msg_device_desc, 253 .dev = &msg_device_desc,
254 .max_speed = USB_SPEED_SUPER, 254 .max_speed = USB_SPEED_SUPER,
diff --git a/drivers/usb/gadget/legacy/multi.c b/drivers/usb/gadget/legacy/multi.c
index 39d27bb343b4..b21b51f0c9fa 100644
--- a/drivers/usb/gadget/legacy/multi.c
+++ b/drivers/usb/gadget/legacy/multi.c
@@ -149,7 +149,7 @@ static struct usb_function *f_acm_rndis;
149static struct usb_function *f_rndis; 149static struct usb_function *f_rndis;
150static struct usb_function *f_msg_rndis; 150static struct usb_function *f_msg_rndis;
151 151
152static __init int rndis_do_config(struct usb_configuration *c) 152static int rndis_do_config(struct usb_configuration *c)
153{ 153{
154 struct fsg_opts *fsg_opts; 154 struct fsg_opts *fsg_opts;
155 int ret; 155 int ret;
@@ -237,7 +237,7 @@ static struct usb_function *f_acm_multi;
237static struct usb_function *f_ecm; 237static struct usb_function *f_ecm;
238static struct usb_function *f_msg_multi; 238static struct usb_function *f_msg_multi;
239 239
240static __init int cdc_do_config(struct usb_configuration *c) 240static int cdc_do_config(struct usb_configuration *c)
241{ 241{
242 struct fsg_opts *fsg_opts; 242 struct fsg_opts *fsg_opts;
243 int ret; 243 int ret;
@@ -466,7 +466,7 @@ fail:
466 return status; 466 return status;
467} 467}
468 468
469static int __exit multi_unbind(struct usb_composite_dev *cdev) 469static int multi_unbind(struct usb_composite_dev *cdev)
470{ 470{
471#ifdef CONFIG_USB_G_MULTI_CDC 471#ifdef CONFIG_USB_G_MULTI_CDC
472 usb_put_function(f_msg_multi); 472 usb_put_function(f_msg_multi);
@@ -497,13 +497,13 @@ static int __exit multi_unbind(struct usb_composite_dev *cdev)
497/****************************** Some noise ******************************/ 497/****************************** Some noise ******************************/
498 498
499 499
500static __refdata struct usb_composite_driver multi_driver = { 500static struct usb_composite_driver multi_driver = {
501 .name = "g_multi", 501 .name = "g_multi",
502 .dev = &device_desc, 502 .dev = &device_desc,
503 .strings = dev_strings, 503 .strings = dev_strings,
504 .max_speed = USB_SPEED_HIGH, 504 .max_speed = USB_SPEED_HIGH,
505 .bind = multi_bind, 505 .bind = multi_bind,
506 .unbind = __exit_p(multi_unbind), 506 .unbind = multi_unbind,
507 .needs_serial = 1, 507 .needs_serial = 1,
508}; 508};
509 509
diff --git a/drivers/usb/gadget/legacy/ncm.c b/drivers/usb/gadget/legacy/ncm.c
index e90e23db2acb..6ce7421412e9 100644
--- a/drivers/usb/gadget/legacy/ncm.c
+++ b/drivers/usb/gadget/legacy/ncm.c
@@ -107,7 +107,7 @@ static struct usb_function *f_ncm;
107 107
108/*-------------------------------------------------------------------------*/ 108/*-------------------------------------------------------------------------*/
109 109
110static int __init ncm_do_config(struct usb_configuration *c) 110static int ncm_do_config(struct usb_configuration *c)
111{ 111{
112 int status; 112 int status;
113 113
@@ -143,7 +143,7 @@ static struct usb_configuration ncm_config_driver = {
143 143
144/*-------------------------------------------------------------------------*/ 144/*-------------------------------------------------------------------------*/
145 145
146static int __init gncm_bind(struct usb_composite_dev *cdev) 146static int gncm_bind(struct usb_composite_dev *cdev)
147{ 147{
148 struct usb_gadget *gadget = cdev->gadget; 148 struct usb_gadget *gadget = cdev->gadget;
149 struct f_ncm_opts *ncm_opts; 149 struct f_ncm_opts *ncm_opts;
@@ -186,7 +186,7 @@ fail:
186 return status; 186 return status;
187} 187}
188 188
189static int __exit gncm_unbind(struct usb_composite_dev *cdev) 189static int gncm_unbind(struct usb_composite_dev *cdev)
190{ 190{
191 if (!IS_ERR_OR_NULL(f_ncm)) 191 if (!IS_ERR_OR_NULL(f_ncm))
192 usb_put_function(f_ncm); 192 usb_put_function(f_ncm);
@@ -195,13 +195,13 @@ static int __exit gncm_unbind(struct usb_composite_dev *cdev)
195 return 0; 195 return 0;
196} 196}
197 197
198static __refdata struct usb_composite_driver ncm_driver = { 198static struct usb_composite_driver ncm_driver = {
199 .name = "g_ncm", 199 .name = "g_ncm",
200 .dev = &device_desc, 200 .dev = &device_desc,
201 .strings = dev_strings, 201 .strings = dev_strings,
202 .max_speed = USB_SPEED_HIGH, 202 .max_speed = USB_SPEED_HIGH,
203 .bind = gncm_bind, 203 .bind = gncm_bind,
204 .unbind = __exit_p(gncm_unbind), 204 .unbind = gncm_unbind,
205}; 205};
206 206
207module_usb_composite_driver(ncm_driver); 207module_usb_composite_driver(ncm_driver);
diff --git a/drivers/usb/gadget/legacy/nokia.c b/drivers/usb/gadget/legacy/nokia.c
index 9b8fd701648c..4bb498a38a1c 100644
--- a/drivers/usb/gadget/legacy/nokia.c
+++ b/drivers/usb/gadget/legacy/nokia.c
@@ -118,7 +118,7 @@ static struct usb_function_instance *fi_obex1;
118static struct usb_function_instance *fi_obex2; 118static struct usb_function_instance *fi_obex2;
119static struct usb_function_instance *fi_phonet; 119static struct usb_function_instance *fi_phonet;
120 120
121static int __init nokia_bind_config(struct usb_configuration *c) 121static int nokia_bind_config(struct usb_configuration *c)
122{ 122{
123 struct usb_function *f_acm; 123 struct usb_function *f_acm;
124 struct usb_function *f_phonet = NULL; 124 struct usb_function *f_phonet = NULL;
@@ -224,7 +224,7 @@ err_get_acm:
224 return status; 224 return status;
225} 225}
226 226
227static int __init nokia_bind(struct usb_composite_dev *cdev) 227static int nokia_bind(struct usb_composite_dev *cdev)
228{ 228{
229 struct usb_gadget *gadget = cdev->gadget; 229 struct usb_gadget *gadget = cdev->gadget;
230 int status; 230 int status;
@@ -307,7 +307,7 @@ err_usb:
307 return status; 307 return status;
308} 308}
309 309
310static int __exit nokia_unbind(struct usb_composite_dev *cdev) 310static int nokia_unbind(struct usb_composite_dev *cdev)
311{ 311{
312 if (!IS_ERR_OR_NULL(f_obex1_cfg2)) 312 if (!IS_ERR_OR_NULL(f_obex1_cfg2))
313 usb_put_function(f_obex1_cfg2); 313 usb_put_function(f_obex1_cfg2);
@@ -338,13 +338,13 @@ static int __exit nokia_unbind(struct usb_composite_dev *cdev)
338 return 0; 338 return 0;
339} 339}
340 340
341static __refdata struct usb_composite_driver nokia_driver = { 341static struct usb_composite_driver nokia_driver = {
342 .name = "g_nokia", 342 .name = "g_nokia",
343 .dev = &device_desc, 343 .dev = &device_desc,
344 .strings = dev_strings, 344 .strings = dev_strings,
345 .max_speed = USB_SPEED_HIGH, 345 .max_speed = USB_SPEED_HIGH,
346 .bind = nokia_bind, 346 .bind = nokia_bind,
347 .unbind = __exit_p(nokia_unbind), 347 .unbind = nokia_unbind,
348}; 348};
349 349
350module_usb_composite_driver(nokia_driver); 350module_usb_composite_driver(nokia_driver);
diff --git a/drivers/usb/gadget/legacy/printer.c b/drivers/usb/gadget/legacy/printer.c
index d5b6ee725a2a..1ce7df1060a5 100644
--- a/drivers/usb/gadget/legacy/printer.c
+++ b/drivers/usb/gadget/legacy/printer.c
@@ -126,7 +126,7 @@ static struct usb_configuration printer_cfg_driver = {
126 .bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER, 126 .bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
127}; 127};
128 128
129static int __init printer_do_config(struct usb_configuration *c) 129static int printer_do_config(struct usb_configuration *c)
130{ 130{
131 struct usb_gadget *gadget = c->cdev->gadget; 131 struct usb_gadget *gadget = c->cdev->gadget;
132 int status = 0; 132 int status = 0;
@@ -152,7 +152,7 @@ static int __init printer_do_config(struct usb_configuration *c)
152 return status; 152 return status;
153} 153}
154 154
155static int __init printer_bind(struct usb_composite_dev *cdev) 155static int printer_bind(struct usb_composite_dev *cdev)
156{ 156{
157 struct f_printer_opts *opts; 157 struct f_printer_opts *opts;
158 int ret, len; 158 int ret, len;
@@ -191,7 +191,7 @@ static int __init printer_bind(struct usb_composite_dev *cdev)
191 return ret; 191 return ret;
192} 192}
193 193
194static int __exit printer_unbind(struct usb_composite_dev *cdev) 194static int printer_unbind(struct usb_composite_dev *cdev)
195{ 195{
196 usb_put_function(f_printer); 196 usb_put_function(f_printer);
197 usb_put_function_instance(fi_printer); 197 usb_put_function_instance(fi_printer);
@@ -199,7 +199,7 @@ static int __exit printer_unbind(struct usb_composite_dev *cdev)
199 return 0; 199 return 0;
200} 200}
201 201
202static __refdata struct usb_composite_driver printer_driver = { 202static struct usb_composite_driver printer_driver = {
203 .name = shortname, 203 .name = shortname,
204 .dev = &device_desc, 204 .dev = &device_desc,
205 .strings = dev_strings, 205 .strings = dev_strings,
diff --git a/drivers/usb/gadget/legacy/serial.c b/drivers/usb/gadget/legacy/serial.c
index 1f5f978d35d5..8b7528f9b78e 100644
--- a/drivers/usb/gadget/legacy/serial.c
+++ b/drivers/usb/gadget/legacy/serial.c
@@ -174,7 +174,7 @@ out:
174 return ret; 174 return ret;
175} 175}
176 176
177static int __init gs_bind(struct usb_composite_dev *cdev) 177static int gs_bind(struct usb_composite_dev *cdev)
178{ 178{
179 int status; 179 int status;
180 180
@@ -230,7 +230,7 @@ static int gs_unbind(struct usb_composite_dev *cdev)
230 return 0; 230 return 0;
231} 231}
232 232
233static __refdata struct usb_composite_driver gserial_driver = { 233static struct usb_composite_driver gserial_driver = {
234 .name = "g_serial", 234 .name = "g_serial",
235 .dev = &device_desc, 235 .dev = &device_desc,
236 .strings = dev_strings, 236 .strings = dev_strings,
diff --git a/drivers/usb/gadget/legacy/tcm_usb_gadget.c b/drivers/usb/gadget/legacy/tcm_usb_gadget.c
index 8b80addc4ce6..f9b4882fce52 100644
--- a/drivers/usb/gadget/legacy/tcm_usb_gadget.c
+++ b/drivers/usb/gadget/legacy/tcm_usb_gadget.c
@@ -2397,7 +2397,7 @@ static int usb_target_bind(struct usb_composite_dev *cdev)
2397 return 0; 2397 return 0;
2398} 2398}
2399 2399
2400static __refdata struct usb_composite_driver usbg_driver = { 2400static struct usb_composite_driver usbg_driver = {
2401 .name = "g_target", 2401 .name = "g_target",
2402 .dev = &usbg_device_desc, 2402 .dev = &usbg_device_desc,
2403 .strings = usbg_strings, 2403 .strings = usbg_strings,
diff --git a/drivers/usb/gadget/legacy/webcam.c b/drivers/usb/gadget/legacy/webcam.c
index 04a3da20f742..72c976bf3530 100644
--- a/drivers/usb/gadget/legacy/webcam.c
+++ b/drivers/usb/gadget/legacy/webcam.c
@@ -334,7 +334,7 @@ static const struct uvc_descriptor_header * const uvc_ss_streaming_cls[] = {
334 * USB configuration 334 * USB configuration
335 */ 335 */
336 336
337static int __init 337static int
338webcam_config_bind(struct usb_configuration *c) 338webcam_config_bind(struct usb_configuration *c)
339{ 339{
340 int status = 0; 340 int status = 0;
@@ -358,7 +358,7 @@ static struct usb_configuration webcam_config_driver = {
358 .MaxPower = CONFIG_USB_GADGET_VBUS_DRAW, 358 .MaxPower = CONFIG_USB_GADGET_VBUS_DRAW,
359}; 359};
360 360
361static int /* __init_or_exit */ 361static int
362webcam_unbind(struct usb_composite_dev *cdev) 362webcam_unbind(struct usb_composite_dev *cdev)
363{ 363{
364 if (!IS_ERR_OR_NULL(f_uvc)) 364 if (!IS_ERR_OR_NULL(f_uvc))
@@ -368,7 +368,7 @@ webcam_unbind(struct usb_composite_dev *cdev)
368 return 0; 368 return 0;
369} 369}
370 370
371static int __init 371static int
372webcam_bind(struct usb_composite_dev *cdev) 372webcam_bind(struct usb_composite_dev *cdev)
373{ 373{
374 struct f_uvc_opts *uvc_opts; 374 struct f_uvc_opts *uvc_opts;
@@ -422,7 +422,7 @@ error:
422 * Driver 422 * Driver
423 */ 423 */
424 424
425static __refdata struct usb_composite_driver webcam_driver = { 425static struct usb_composite_driver webcam_driver = {
426 .name = "g_webcam", 426 .name = "g_webcam",
427 .dev = &webcam_device_descriptor, 427 .dev = &webcam_device_descriptor,
428 .strings = webcam_device_strings, 428 .strings = webcam_device_strings,
diff --git a/drivers/usb/gadget/legacy/zero.c b/drivers/usb/gadget/legacy/zero.c
index 5ee95152493c..c986e8addb90 100644
--- a/drivers/usb/gadget/legacy/zero.c
+++ b/drivers/usb/gadget/legacy/zero.c
@@ -272,7 +272,7 @@ static struct usb_function_instance *func_inst_lb;
272module_param_named(qlen, gzero_options.qlen, uint, S_IRUGO|S_IWUSR); 272module_param_named(qlen, gzero_options.qlen, uint, S_IRUGO|S_IWUSR);
273MODULE_PARM_DESC(qlen, "depth of loopback queue"); 273MODULE_PARM_DESC(qlen, "depth of loopback queue");
274 274
275static int __init zero_bind(struct usb_composite_dev *cdev) 275static int zero_bind(struct usb_composite_dev *cdev)
276{ 276{
277 struct f_ss_opts *ss_opts; 277 struct f_ss_opts *ss_opts;
278 struct f_lb_opts *lb_opts; 278 struct f_lb_opts *lb_opts;
@@ -400,7 +400,7 @@ static int zero_unbind(struct usb_composite_dev *cdev)
400 return 0; 400 return 0;
401} 401}
402 402
403static __refdata struct usb_composite_driver zero_driver = { 403static struct usb_composite_driver zero_driver = {
404 .name = "zero", 404 .name = "zero",
405 .dev = &device_desc, 405 .dev = &device_desc,
406 .strings = dev_strings, 406 .strings = dev_strings,
diff --git a/drivers/usb/gadget/udc/at91_udc.c b/drivers/usb/gadget/udc/at91_udc.c
index 2fbedca3c2b4..fc4226462f8f 100644
--- a/drivers/usb/gadget/udc/at91_udc.c
+++ b/drivers/usb/gadget/udc/at91_udc.c
@@ -1942,7 +1942,7 @@ err_unprepare_fclk:
1942 return retval; 1942 return retval;
1943} 1943}
1944 1944
1945static int __exit at91udc_remove(struct platform_device *pdev) 1945static int at91udc_remove(struct platform_device *pdev)
1946{ 1946{
1947 struct at91_udc *udc = platform_get_drvdata(pdev); 1947 struct at91_udc *udc = platform_get_drvdata(pdev);
1948 unsigned long flags; 1948 unsigned long flags;
@@ -2018,7 +2018,7 @@ static int at91udc_resume(struct platform_device *pdev)
2018#endif 2018#endif
2019 2019
2020static struct platform_driver at91_udc_driver = { 2020static struct platform_driver at91_udc_driver = {
2021 .remove = __exit_p(at91udc_remove), 2021 .remove = at91udc_remove,
2022 .shutdown = at91udc_shutdown, 2022 .shutdown = at91udc_shutdown,
2023 .suspend = at91udc_suspend, 2023 .suspend = at91udc_suspend,
2024 .resume = at91udc_resume, 2024 .resume = at91udc_resume,
diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
index 4c01953a0869..351d48550c33 100644
--- a/drivers/usb/gadget/udc/atmel_usba_udc.c
+++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
@@ -2186,7 +2186,7 @@ static int usba_udc_probe(struct platform_device *pdev)
2186 return 0; 2186 return 0;
2187} 2187}
2188 2188
2189static int __exit usba_udc_remove(struct platform_device *pdev) 2189static int usba_udc_remove(struct platform_device *pdev)
2190{ 2190{
2191 struct usba_udc *udc; 2191 struct usba_udc *udc;
2192 int i; 2192 int i;
@@ -2258,7 +2258,7 @@ static int usba_udc_resume(struct device *dev)
2258static SIMPLE_DEV_PM_OPS(usba_udc_pm_ops, usba_udc_suspend, usba_udc_resume); 2258static SIMPLE_DEV_PM_OPS(usba_udc_pm_ops, usba_udc_suspend, usba_udc_resume);
2259 2259
2260static struct platform_driver udc_driver = { 2260static struct platform_driver udc_driver = {
2261 .remove = __exit_p(usba_udc_remove), 2261 .remove = usba_udc_remove,
2262 .driver = { 2262 .driver = {
2263 .name = "atmel_usba_udc", 2263 .name = "atmel_usba_udc",
2264 .pm = &usba_udc_pm_ops, 2264 .pm = &usba_udc_pm_ops,
diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/drivers/usb/gadget/udc/fsl_udc_core.c
index 55fcb930f92e..c60022b46a48 100644
--- a/drivers/usb/gadget/udc/fsl_udc_core.c
+++ b/drivers/usb/gadget/udc/fsl_udc_core.c
@@ -2525,7 +2525,7 @@ err_kfree:
2525/* Driver removal function 2525/* Driver removal function
2526 * Free resources and finish pending transactions 2526 * Free resources and finish pending transactions
2527 */ 2527 */
2528static int __exit fsl_udc_remove(struct platform_device *pdev) 2528static int fsl_udc_remove(struct platform_device *pdev)
2529{ 2529{
2530 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 2530 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
2531 struct fsl_usb2_platform_data *pdata = dev_get_platdata(&pdev->dev); 2531 struct fsl_usb2_platform_data *pdata = dev_get_platdata(&pdev->dev);
@@ -2663,7 +2663,7 @@ static const struct platform_device_id fsl_udc_devtype[] = {
2663}; 2663};
2664MODULE_DEVICE_TABLE(platform, fsl_udc_devtype); 2664MODULE_DEVICE_TABLE(platform, fsl_udc_devtype);
2665static struct platform_driver udc_driver = { 2665static struct platform_driver udc_driver = {
2666 .remove = __exit_p(fsl_udc_remove), 2666 .remove = fsl_udc_remove,
2667 /* Just for FSL i.mx SoC currently */ 2667 /* Just for FSL i.mx SoC currently */
2668 .id_table = fsl_udc_devtype, 2668 .id_table = fsl_udc_devtype,
2669 /* these suspend and resume are not usb suspend and resume */ 2669 /* these suspend and resume are not usb suspend and resume */
diff --git a/drivers/usb/gadget/udc/fusb300_udc.c b/drivers/usb/gadget/udc/fusb300_udc.c
index fb4df159d32d..3970f453de49 100644
--- a/drivers/usb/gadget/udc/fusb300_udc.c
+++ b/drivers/usb/gadget/udc/fusb300_udc.c
@@ -1342,7 +1342,7 @@ static const struct usb_gadget_ops fusb300_gadget_ops = {
1342 .udc_stop = fusb300_udc_stop, 1342 .udc_stop = fusb300_udc_stop,
1343}; 1343};
1344 1344
1345static int __exit fusb300_remove(struct platform_device *pdev) 1345static int fusb300_remove(struct platform_device *pdev)
1346{ 1346{
1347 struct fusb300 *fusb300 = platform_get_drvdata(pdev); 1347 struct fusb300 *fusb300 = platform_get_drvdata(pdev);
1348 1348
@@ -1492,7 +1492,7 @@ clean_up:
1492} 1492}
1493 1493
1494static struct platform_driver fusb300_driver = { 1494static struct platform_driver fusb300_driver = {
1495 .remove = __exit_p(fusb300_remove), 1495 .remove = fusb300_remove,
1496 .driver = { 1496 .driver = {
1497 .name = (char *) udc_name, 1497 .name = (char *) udc_name,
1498 }, 1498 },
diff --git a/drivers/usb/gadget/udc/m66592-udc.c b/drivers/usb/gadget/udc/m66592-udc.c
index 8c7c83c93713..309706fe4bf0 100644
--- a/drivers/usb/gadget/udc/m66592-udc.c
+++ b/drivers/usb/gadget/udc/m66592-udc.c
@@ -1528,7 +1528,7 @@ static const struct usb_gadget_ops m66592_gadget_ops = {
1528 .pullup = m66592_pullup, 1528 .pullup = m66592_pullup,
1529}; 1529};
1530 1530
1531static int __exit m66592_remove(struct platform_device *pdev) 1531static int m66592_remove(struct platform_device *pdev)
1532{ 1532{
1533 struct m66592 *m66592 = platform_get_drvdata(pdev); 1533 struct m66592 *m66592 = platform_get_drvdata(pdev);
1534 1534
@@ -1695,7 +1695,7 @@ clean_up:
1695 1695
1696/*-------------------------------------------------------------------------*/ 1696/*-------------------------------------------------------------------------*/
1697static struct platform_driver m66592_driver = { 1697static struct platform_driver m66592_driver = {
1698 .remove = __exit_p(m66592_remove), 1698 .remove = m66592_remove,
1699 .driver = { 1699 .driver = {
1700 .name = (char *) udc_name, 1700 .name = (char *) udc_name,
1701 }, 1701 },
diff --git a/drivers/usb/gadget/udc/r8a66597-udc.c b/drivers/usb/gadget/udc/r8a66597-udc.c
index 2495fe9c95c5..0293f7169dee 100644
--- a/drivers/usb/gadget/udc/r8a66597-udc.c
+++ b/drivers/usb/gadget/udc/r8a66597-udc.c
@@ -1820,7 +1820,7 @@ static const struct usb_gadget_ops r8a66597_gadget_ops = {
1820 .set_selfpowered = r8a66597_set_selfpowered, 1820 .set_selfpowered = r8a66597_set_selfpowered,
1821}; 1821};
1822 1822
1823static int __exit r8a66597_remove(struct platform_device *pdev) 1823static int r8a66597_remove(struct platform_device *pdev)
1824{ 1824{
1825 struct r8a66597 *r8a66597 = platform_get_drvdata(pdev); 1825 struct r8a66597 *r8a66597 = platform_get_drvdata(pdev);
1826 1826
@@ -1974,7 +1974,7 @@ clean_up2:
1974 1974
1975/*-------------------------------------------------------------------------*/ 1975/*-------------------------------------------------------------------------*/
1976static struct platform_driver r8a66597_driver = { 1976static struct platform_driver r8a66597_driver = {
1977 .remove = __exit_p(r8a66597_remove), 1977 .remove = r8a66597_remove,
1978 .driver = { 1978 .driver = {
1979 .name = (char *) udc_name, 1979 .name = (char *) udc_name,
1980 }, 1980 },
diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c
index dd3e9fd31b80..1f24274477ab 100644
--- a/drivers/usb/gadget/udc/udc-xilinx.c
+++ b/drivers/usb/gadget/udc/udc-xilinx.c
@@ -2071,8 +2071,8 @@ static int xudc_probe(struct platform_device *pdev)
2071 /* Map the registers */ 2071 /* Map the registers */
2072 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 2072 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
2073 udc->addr = devm_ioremap_resource(&pdev->dev, res); 2073 udc->addr = devm_ioremap_resource(&pdev->dev, res);
2074 if (!udc->addr) 2074 if (IS_ERR(udc->addr))
2075 return -ENOMEM; 2075 return PTR_ERR(udc->addr);
2076 2076
2077 irq = platform_get_irq(pdev, 0); 2077 irq = platform_get_irq(pdev, 0);
2078 if (irq < 0) { 2078 if (irq < 0) {
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index f5397a517c54..7d34cbfaf373 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -2026,8 +2026,13 @@ static int process_isoc_td(struct xhci_hcd *xhci, struct xhci_td *td,
2026 break; 2026 break;
2027 case COMP_DEV_ERR: 2027 case COMP_DEV_ERR:
2028 case COMP_STALL: 2028 case COMP_STALL:
2029 frame->status = -EPROTO;
2030 skip_td = true;
2031 break;
2029 case COMP_TX_ERR: 2032 case COMP_TX_ERR:
2030 frame->status = -EPROTO; 2033 frame->status = -EPROTO;
2034 if (event_trb != td->last_trb)
2035 return 0;
2031 skip_td = true; 2036 skip_td = true;
2032 break; 2037 break;
2033 case COMP_STOP: 2038 case COMP_STOP:
@@ -2640,7 +2645,7 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd)
2640 xhci_halt(xhci); 2645 xhci_halt(xhci);
2641hw_died: 2646hw_died:
2642 spin_unlock(&xhci->lock); 2647 spin_unlock(&xhci->lock);
2643 return -ESHUTDOWN; 2648 return IRQ_HANDLED;
2644 } 2649 }
2645 2650
2646 /* 2651 /*
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 8e421b89632d..ea75e8ccd3c1 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1267,7 +1267,7 @@ union xhci_trb {
1267 * since the command ring is 64-byte aligned. 1267 * since the command ring is 64-byte aligned.
1268 * It must also be greater than 16. 1268 * It must also be greater than 16.
1269 */ 1269 */
1270#define TRBS_PER_SEGMENT 64 1270#define TRBS_PER_SEGMENT 256
1271/* Allow two commands + a link TRB, along with any reserved command TRBs */ 1271/* Allow two commands + a link TRB, along with any reserved command TRBs */
1272#define MAX_RSVD_CMD_TRBS (TRBS_PER_SEGMENT - 3) 1272#define MAX_RSVD_CMD_TRBS (TRBS_PER_SEGMENT - 3)
1273#define TRB_SEGMENT_SIZE (TRBS_PER_SEGMENT*16) 1273#define TRB_SEGMENT_SIZE (TRBS_PER_SEGMENT*16)
diff --git a/drivers/usb/phy/phy-isp1301-omap.c b/drivers/usb/phy/phy-isp1301-omap.c
index 1e0e10dd6ba5..3af263cc0caa 100644
--- a/drivers/usb/phy/phy-isp1301-omap.c
+++ b/drivers/usb/phy/phy-isp1301-omap.c
@@ -94,7 +94,7 @@ struct isp1301 {
94 94
95#if defined(CONFIG_MACH_OMAP_H2) || defined(CONFIG_MACH_OMAP_H3) 95#if defined(CONFIG_MACH_OMAP_H2) || defined(CONFIG_MACH_OMAP_H3)
96 96
97#if defined(CONFIG_TPS65010) || defined(CONFIG_TPS65010_MODULE) 97#if defined(CONFIG_TPS65010) || (defined(CONFIG_TPS65010_MODULE) && defined(MODULE))
98 98
99#include <linux/i2c/tps65010.h> 99#include <linux/i2c/tps65010.h>
100 100
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 84ce2d74894c..9031750e7404 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -127,6 +127,7 @@ static const struct usb_device_id id_table[] = {
127 { USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */ 127 { USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */
128 { USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */ 128 { USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */
129 { USB_DEVICE(0x10C4, 0x8977) }, /* CEL MeshWorks DevKit Device */ 129 { USB_DEVICE(0x10C4, 0x8977) }, /* CEL MeshWorks DevKit Device */
130 { USB_DEVICE(0x10C4, 0x8998) }, /* KCF Technologies PRN */
130 { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ 131 { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
131 { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ 132 { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */
132 { USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */ 133 { USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 829604d11f3f..f5257af33ecf 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -61,7 +61,6 @@ static const struct usb_device_id id_table[] = {
61 { USB_DEVICE(DCU10_VENDOR_ID, DCU10_PRODUCT_ID) }, 61 { USB_DEVICE(DCU10_VENDOR_ID, DCU10_PRODUCT_ID) },
62 { USB_DEVICE(SITECOM_VENDOR_ID, SITECOM_PRODUCT_ID) }, 62 { USB_DEVICE(SITECOM_VENDOR_ID, SITECOM_PRODUCT_ID) },
63 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_ID) }, 63 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_ID) },
64 { USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_ID) },
65 { USB_DEVICE(SIEMENS_VENDOR_ID, SIEMENS_PRODUCT_ID_SX1), 64 { USB_DEVICE(SIEMENS_VENDOR_ID, SIEMENS_PRODUCT_ID_SX1),
66 .driver_info = PL2303_QUIRK_UART_STATE_IDX0 }, 65 .driver_info = PL2303_QUIRK_UART_STATE_IDX0 },
67 { USB_DEVICE(SIEMENS_VENDOR_ID, SIEMENS_PRODUCT_ID_X65), 66 { USB_DEVICE(SIEMENS_VENDOR_ID, SIEMENS_PRODUCT_ID_X65),
diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h
index 71fd9da1d6e7..e3b7af8adfb7 100644
--- a/drivers/usb/serial/pl2303.h
+++ b/drivers/usb/serial/pl2303.h
@@ -62,10 +62,6 @@
62#define ALCATEL_VENDOR_ID 0x11f7 62#define ALCATEL_VENDOR_ID 0x11f7
63#define ALCATEL_PRODUCT_ID 0x02df 63#define ALCATEL_PRODUCT_ID 0x02df
64 64
65/* Samsung I330 phone cradle */
66#define SAMSUNG_VENDOR_ID 0x04e8
67#define SAMSUNG_PRODUCT_ID 0x8001
68
69#define SIEMENS_VENDOR_ID 0x11f5 65#define SIEMENS_VENDOR_ID 0x11f5
70#define SIEMENS_PRODUCT_ID_SX1 0x0001 66#define SIEMENS_PRODUCT_ID_SX1 0x0001
71#define SIEMENS_PRODUCT_ID_X65 0x0003 67#define SIEMENS_PRODUCT_ID_X65 0x0003
diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
index bf2bd40e5f2a..60afb39eb73c 100644
--- a/drivers/usb/serial/visor.c
+++ b/drivers/usb/serial/visor.c
@@ -95,7 +95,7 @@ static const struct usb_device_id id_table[] = {
95 .driver_info = (kernel_ulong_t)&palm_os_4_probe }, 95 .driver_info = (kernel_ulong_t)&palm_os_4_probe },
96 { USB_DEVICE(ACER_VENDOR_ID, ACER_S10_ID), 96 { USB_DEVICE(ACER_VENDOR_ID, ACER_S10_ID),
97 .driver_info = (kernel_ulong_t)&palm_os_4_probe }, 97 .driver_info = (kernel_ulong_t)&palm_os_4_probe },
98 { USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_SCH_I330_ID), 98 { USB_DEVICE_INTERFACE_CLASS(SAMSUNG_VENDOR_ID, SAMSUNG_SCH_I330_ID, 0xff),
99 .driver_info = (kernel_ulong_t)&palm_os_4_probe }, 99 .driver_info = (kernel_ulong_t)&palm_os_4_probe },
100 { USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_SPH_I500_ID), 100 { USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_SPH_I500_ID),
101 .driver_info = (kernel_ulong_t)&palm_os_4_probe }, 101 .driver_info = (kernel_ulong_t)&palm_os_4_probe },
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index d684b4b8108f..caf188800c67 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -766,6 +766,13 @@ UNUSUAL_DEV( 0x059f, 0x0643, 0x0000, 0x0000,
766 USB_SC_DEVICE, USB_PR_DEVICE, NULL, 766 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
767 US_FL_GO_SLOW ), 767 US_FL_GO_SLOW ),
768 768
769/* Reported by Christian Schaller <cschalle@redhat.com> */
770UNUSUAL_DEV( 0x059f, 0x0651, 0x0000, 0x0000,
771 "LaCie",
772 "External HDD",
773 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
774 US_FL_NO_WP_DETECT ),
775
769/* Submitted by Joel Bourquard <numlock@freesurf.ch> 776/* Submitted by Joel Bourquard <numlock@freesurf.ch>
770 * Some versions of this device need the SubClass and Protocol overrides 777 * Some versions of this device need the SubClass and Protocol overrides
771 * while others don't. 778 * while others don't.