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

+5 -1
drivers/usb/chipidea/debug.c
··· 88 88 char buf[32]; 89 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 93 return -EFAULT; 94 + 95 + /* sscanf requires a zero terminated string */ 96 + buf[count] = '\0'; 93 97 94 98 if (sscanf(buf, "%u", &mode) != 1) 95 99 return -EINVAL;
+3
drivers/usb/core/quirks.c
··· 106 106 { USB_DEVICE(0x04f3, 0x010c), .driver_info = 107 107 USB_QUIRK_DEVICE_QUALIFIER }, 108 108 109 + { USB_DEVICE(0x04f3, 0x0125), .driver_info = 110 + USB_QUIRK_DEVICE_QUALIFIER }, 111 + 109 112 { USB_DEVICE(0x04f3, 0x016f), .driver_info = 110 113 USB_QUIRK_DEVICE_QUALIFIER }, 111 114
+47 -47
drivers/usb/dwc3/dwc3-omap.c
··· 65 65 #define USBOTGSS_IRQENABLE_SET_MISC 0x003c 66 66 #define USBOTGSS_IRQENABLE_CLR_MISC 0x0040 67 67 #define USBOTGSS_IRQMISC_OFFSET 0x03fc 68 - #define USBOTGSS_UTMI_OTG_CTRL 0x0080 69 - #define USBOTGSS_UTMI_OTG_STATUS 0x0084 68 + #define USBOTGSS_UTMI_OTG_STATUS 0x0080 69 + #define USBOTGSS_UTMI_OTG_CTRL 0x0084 70 70 #define USBOTGSS_UTMI_OTG_OFFSET 0x0480 71 71 #define USBOTGSS_TXFIFO_DEPTH 0x0508 72 72 #define USBOTGSS_RXFIFO_DEPTH 0x050c ··· 98 98 #define USBOTGSS_IRQMISC_DISCHRGVBUS_FALL (1 << 3) 99 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 101 /* UTMI_OTG_STATUS REGISTER */ 108 - #define USBOTGSS_UTMI_OTG_STATUS_SW_MODE (1 << 31) 109 - #define USBOTGSS_UTMI_OTG_STATUS_POWERPRESENT (1 << 9) 110 - #define USBOTGSS_UTMI_OTG_STATUS_TXBITSTUFFENABLE (1 << 8) 111 - #define USBOTGSS_UTMI_OTG_STATUS_IDDIG (1 << 4) 112 - #define USBOTGSS_UTMI_OTG_STATUS_SESSEND (1 << 3) 113 - #define USBOTGSS_UTMI_OTG_STATUS_SESSVALID (1 << 2) 114 - #define USBOTGSS_UTMI_OTG_STATUS_VBUSVALID (1 << 1) 102 + #define USBOTGSS_UTMI_OTG_STATUS_DRVVBUS (1 << 5) 103 + #define USBOTGSS_UTMI_OTG_STATUS_CHRGVBUS (1 << 4) 104 + #define USBOTGSS_UTMI_OTG_STATUS_DISCHRGVBUS (1 << 3) 105 + #define USBOTGSS_UTMI_OTG_STATUS_IDPULLUP (1 << 0) 106 + 107 + /* UTMI_OTG_CTRL REGISTER */ 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 116 116 struct dwc3_omap { 117 117 struct device *dev; ··· 119 119 int irq; 120 120 void __iomem *base; 121 121 122 - u32 utmi_otg_status; 122 + u32 utmi_otg_ctrl; 123 123 u32 utmi_otg_offset; 124 124 u32 irqmisc_offset; 125 125 u32 irq_eoi_offset; ··· 153 153 writel(value, base + offset); 154 154 } 155 155 156 - static u32 dwc3_omap_read_utmi_status(struct dwc3_omap *omap) 156 + static 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 159 omap->utmi_otg_offset); 160 160 } 161 161 162 - static void dwc3_omap_write_utmi_status(struct dwc3_omap *omap, u32 value) 162 + static 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 165 omap->utmi_otg_offset, value); 166 166 167 167 } ··· 235 235 } 236 236 } 237 237 238 - val = dwc3_omap_read_utmi_status(omap); 239 - val &= ~(USBOTGSS_UTMI_OTG_STATUS_IDDIG 240 - | USBOTGSS_UTMI_OTG_STATUS_VBUSVALID 241 - | USBOTGSS_UTMI_OTG_STATUS_SESSEND); 242 - val |= USBOTGSS_UTMI_OTG_STATUS_SESSVALID 243 - | USBOTGSS_UTMI_OTG_STATUS_POWERPRESENT; 244 - dwc3_omap_write_utmi_status(omap, val); 238 + val = dwc3_omap_read_utmi_ctrl(omap); 239 + val &= ~(USBOTGSS_UTMI_OTG_CTRL_IDDIG 240 + | USBOTGSS_UTMI_OTG_CTRL_VBUSVALID 241 + | USBOTGSS_UTMI_OTG_CTRL_SESSEND); 242 + val |= USBOTGSS_UTMI_OTG_CTRL_SESSVALID 243 + | USBOTGSS_UTMI_OTG_CTRL_POWERPRESENT; 244 + dwc3_omap_write_utmi_ctrl(omap, val); 245 245 break; 246 246 247 247 case OMAP_DWC3_VBUS_VALID: 248 248 dev_dbg(omap->dev, "VBUS Connect\n"); 249 249 250 - val = dwc3_omap_read_utmi_status(omap); 251 - val &= ~USBOTGSS_UTMI_OTG_STATUS_SESSEND; 252 - val |= USBOTGSS_UTMI_OTG_STATUS_IDDIG 253 - | USBOTGSS_UTMI_OTG_STATUS_VBUSVALID 254 - | USBOTGSS_UTMI_OTG_STATUS_SESSVALID 255 - | USBOTGSS_UTMI_OTG_STATUS_POWERPRESENT; 256 - dwc3_omap_write_utmi_status(omap, val); 250 + val = dwc3_omap_read_utmi_ctrl(omap); 251 + val &= ~USBOTGSS_UTMI_OTG_CTRL_SESSEND; 252 + val |= USBOTGSS_UTMI_OTG_CTRL_IDDIG 253 + | USBOTGSS_UTMI_OTG_CTRL_VBUSVALID 254 + | USBOTGSS_UTMI_OTG_CTRL_SESSVALID 255 + | USBOTGSS_UTMI_OTG_CTRL_POWERPRESENT; 256 + dwc3_omap_write_utmi_ctrl(omap, val); 257 257 break; 258 258 259 259 case OMAP_DWC3_ID_FLOAT: ··· 263 263 case OMAP_DWC3_VBUS_OFF: 264 264 dev_dbg(omap->dev, "VBUS Disconnect\n"); 265 265 266 - val = dwc3_omap_read_utmi_status(omap); 267 - val &= ~(USBOTGSS_UTMI_OTG_STATUS_SESSVALID 268 - | USBOTGSS_UTMI_OTG_STATUS_VBUSVALID 269 - | USBOTGSS_UTMI_OTG_STATUS_POWERPRESENT); 270 - val |= USBOTGSS_UTMI_OTG_STATUS_SESSEND 271 - | USBOTGSS_UTMI_OTG_STATUS_IDDIG; 272 - dwc3_omap_write_utmi_status(omap, val); 266 + val = dwc3_omap_read_utmi_ctrl(omap); 267 + val &= ~(USBOTGSS_UTMI_OTG_CTRL_SESSVALID 268 + | USBOTGSS_UTMI_OTG_CTRL_VBUSVALID 269 + | USBOTGSS_UTMI_OTG_CTRL_POWERPRESENT); 270 + val |= USBOTGSS_UTMI_OTG_CTRL_SESSEND 271 + | USBOTGSS_UTMI_OTG_CTRL_IDDIG; 272 + dwc3_omap_write_utmi_ctrl(omap, val); 273 273 break; 274 274 275 275 default: ··· 422 422 struct device_node *node = omap->dev->of_node; 423 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 427 of_property_read_u32(node, "utmi-mode", &utmi_mode); 428 428 429 429 switch (utmi_mode) { 430 430 case DWC3_OMAP_UTMI_MODE_SW: 431 - reg |= USBOTGSS_UTMI_OTG_STATUS_SW_MODE; 431 + reg |= USBOTGSS_UTMI_OTG_CTRL_SW_MODE; 432 432 break; 433 433 case DWC3_OMAP_UTMI_MODE_HW: 434 - reg &= ~USBOTGSS_UTMI_OTG_STATUS_SW_MODE; 434 + reg &= ~USBOTGSS_UTMI_OTG_CTRL_SW_MODE; 435 435 break; 436 436 default: 437 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 443 443 static int dwc3_omap_extcon_register(struct dwc3_omap *omap) ··· 614 614 { 615 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 618 dwc3_omap_disable_irqs(omap); 619 619 620 620 return 0; ··· 624 624 { 625 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 628 dwc3_omap_enable_irqs(omap); 629 629 630 630 pm_runtime_disable(dev);
+1
drivers/usb/gadget/configfs.c
··· 1295 1295 } 1296 1296 } 1297 1297 c->next_interface_id = 0; 1298 + memset(c->interface, 0, sizeof(c->interface)); 1298 1299 c->superspeed = 0; 1299 1300 c->highspeed = 0; 1300 1301 c->fullspeed = 0;
+14 -2
drivers/usb/gadget/function/f_hid.c
··· 437 437 | USB_REQ_GET_DESCRIPTOR): 438 438 switch (value >> 8) { 439 439 case HID_DT_HID: 440 + { 441 + struct hid_descriptor hidg_desc_copy = hidg_desc; 442 + 440 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 448 length = min_t(unsigned short, length, 442 - hidg_desc.bLength); 443 - memcpy(req->buf, &hidg_desc, length); 449 + hidg_desc_copy.bLength); 450 + memcpy(req->buf, &hidg_desc_copy, length); 444 451 goto respond; 445 452 break; 453 + } 446 454 case HID_DT_REPORT: 447 455 VDBG(cdev, "USB_REQ_GET_DESCRIPTOR: REPORT\n"); 448 456 length = min_t(unsigned short, length, ··· 640 632 hidg_fs_in_ep_desc.wMaxPacketSize = cpu_to_le16(hidg->report_length); 641 633 hidg_hs_out_ep_desc.wMaxPacketSize = cpu_to_le16(hidg->report_length); 642 634 hidg_fs_out_ep_desc.wMaxPacketSize = cpu_to_le16(hidg->report_length); 635 + /* 636 + * We can use hidg_desc struct here but we should not relay 637 + * that its content won't change after returning from this function. 638 + */ 643 639 hidg_desc.desc[0].bDescriptorType = HID_DT_REPORT; 644 640 hidg_desc.desc[0].wDescriptorLength = 645 641 cpu_to_le16(hidg->report_desc_length);
+4 -1
drivers/usb/gadget/function/u_serial.c
··· 113 113 int write_allocated; 114 114 struct gs_buf port_write_buf; 115 115 wait_queue_head_t drain_wait; /* wait while writes drain */ 116 + bool write_busy; 116 117 117 118 /* REVISIT this state ... */ 118 119 struct usb_cdc_line_coding port_line_coding; /* 8-N-1 etc */ ··· 364 363 int status = 0; 365 364 bool do_tty_wake = false; 366 365 367 - while (!list_empty(pool)) { 366 + while (!port->write_busy && !list_empty(pool)) { 368 367 struct usb_request *req; 369 368 int len; 370 369 ··· 394 393 * NOTE that we may keep sending data for a while after 395 394 * the TTY closed (dev->ioport->port_tty is NULL). 396 395 */ 396 + port->write_busy = true; 397 397 spin_unlock(&port->port_lock); 398 398 status = usb_ep_queue(in, req, GFP_ATOMIC); 399 399 spin_lock(&port->port_lock); 400 + port->write_busy = false; 400 401 401 402 if (status) { 402 403 pr_debug("%s: %s %s err %d\n",
+5 -5
drivers/usb/gadget/legacy/acm_ms.c
··· 121 121 /* 122 122 * We _always_ have both ACM and mass storage functions. 123 123 */ 124 - static int __init acm_ms_do_config(struct usb_configuration *c) 124 + static int acm_ms_do_config(struct usb_configuration *c) 125 125 { 126 126 struct fsg_opts *opts; 127 127 int status; ··· 174 174 175 175 /*-------------------------------------------------------------------------*/ 176 176 177 - static int __init acm_ms_bind(struct usb_composite_dev *cdev) 177 + static int acm_ms_bind(struct usb_composite_dev *cdev) 178 178 { 179 179 struct usb_gadget *gadget = cdev->gadget; 180 180 struct fsg_opts *opts; ··· 249 249 return status; 250 250 } 251 251 252 - static int __exit acm_ms_unbind(struct usb_composite_dev *cdev) 252 + static int acm_ms_unbind(struct usb_composite_dev *cdev) 253 253 { 254 254 usb_put_function(f_msg); 255 255 usb_put_function_instance(fi_msg); ··· 258 258 return 0; 259 259 } 260 260 261 - static __refdata struct usb_composite_driver acm_ms_driver = { 261 + static struct usb_composite_driver acm_ms_driver = { 262 262 .name = "g_acm_ms", 263 263 .dev = &device_desc, 264 264 .max_speed = USB_SPEED_SUPER, 265 265 .strings = dev_strings, 266 266 .bind = acm_ms_bind, 267 - .unbind = __exit_p(acm_ms_unbind), 267 + .unbind = acm_ms_unbind, 268 268 }; 269 269 270 270 module_usb_composite_driver(acm_ms_driver);
+5 -5
drivers/usb/gadget/legacy/audio.c
··· 167 167 168 168 /*-------------------------------------------------------------------------*/ 169 169 170 - static int __init audio_do_config(struct usb_configuration *c) 170 + static int audio_do_config(struct usb_configuration *c) 171 171 { 172 172 int status; 173 173 ··· 216 216 217 217 /*-------------------------------------------------------------------------*/ 218 218 219 - static int __init audio_bind(struct usb_composite_dev *cdev) 219 + static int audio_bind(struct usb_composite_dev *cdev) 220 220 { 221 221 #ifndef CONFIG_GADGET_UAC1 222 222 struct f_uac2_opts *uac2_opts; ··· 276 276 return status; 277 277 } 278 278 279 - static int __exit audio_unbind(struct usb_composite_dev *cdev) 279 + static int audio_unbind(struct usb_composite_dev *cdev) 280 280 { 281 281 #ifdef CONFIG_GADGET_UAC1 282 282 if (!IS_ERR_OR_NULL(f_uac1)) ··· 292 292 return 0; 293 293 } 294 294 295 - static __refdata struct usb_composite_driver audio_driver = { 295 + static struct usb_composite_driver audio_driver = { 296 296 .name = "g_audio", 297 297 .dev = &device_desc, 298 298 .strings = audio_strings, 299 299 .max_speed = USB_SPEED_HIGH, 300 300 .bind = audio_bind, 301 - .unbind = __exit_p(audio_unbind), 301 + .unbind = audio_unbind, 302 302 }; 303 303 304 304 module_usb_composite_driver(audio_driver);
+5 -5
drivers/usb/gadget/legacy/cdc2.c
··· 104 104 /* 105 105 * We _always_ have both CDC ECM and CDC ACM functions. 106 106 */ 107 - static int __init cdc_do_config(struct usb_configuration *c) 107 + static int cdc_do_config(struct usb_configuration *c) 108 108 { 109 109 int status; 110 110 ··· 153 153 154 154 /*-------------------------------------------------------------------------*/ 155 155 156 - static int __init cdc_bind(struct usb_composite_dev *cdev) 156 + static int cdc_bind(struct usb_composite_dev *cdev) 157 157 { 158 158 struct usb_gadget *gadget = cdev->gadget; 159 159 struct f_ecm_opts *ecm_opts; ··· 211 211 return status; 212 212 } 213 213 214 - static int __exit cdc_unbind(struct usb_composite_dev *cdev) 214 + static int cdc_unbind(struct usb_composite_dev *cdev) 215 215 { 216 216 usb_put_function(f_acm); 217 217 usb_put_function_instance(fi_serial); ··· 222 222 return 0; 223 223 } 224 224 225 - static __refdata struct usb_composite_driver cdc_driver = { 225 + static struct usb_composite_driver cdc_driver = { 226 226 .name = "g_cdc", 227 227 .dev = &device_desc, 228 228 .strings = dev_strings, 229 229 .max_speed = USB_SPEED_HIGH, 230 230 .bind = cdc_bind, 231 - .unbind = __exit_p(cdc_unbind), 231 + .unbind = cdc_unbind, 232 232 }; 233 233 234 234 module_usb_composite_driver(cdc_driver);
+2 -2
drivers/usb/gadget/legacy/dbgp.c
··· 284 284 return -ENODEV; 285 285 } 286 286 287 - static int __init dbgp_bind(struct usb_gadget *gadget, 287 + static int dbgp_bind(struct usb_gadget *gadget, 288 288 struct usb_gadget_driver *driver) 289 289 { 290 290 int err, stp; ··· 406 406 return err; 407 407 } 408 408 409 - static __refdata struct usb_gadget_driver dbgp_driver = { 409 + static struct usb_gadget_driver dbgp_driver = { 410 410 .function = "dbgp", 411 411 .max_speed = USB_SPEED_HIGH, 412 412 .bind = dbgp_bind,
+6 -6
drivers/usb/gadget/legacy/ether.c
··· 222 222 * the first one present. That's to make Microsoft's drivers happy, 223 223 * and to follow DOCSIS 1.0 (cable modem standard). 224 224 */ 225 - static int __init rndis_do_config(struct usb_configuration *c) 225 + static int rndis_do_config(struct usb_configuration *c) 226 226 { 227 227 int status; 228 228 ··· 264 264 /* 265 265 * We _always_ have an ECM, CDC Subset, or EEM configuration. 266 266 */ 267 - static int __init eth_do_config(struct usb_configuration *c) 267 + static int eth_do_config(struct usb_configuration *c) 268 268 { 269 269 int status = 0; 270 270 ··· 318 318 319 319 /*-------------------------------------------------------------------------*/ 320 320 321 - static int __init eth_bind(struct usb_composite_dev *cdev) 321 + static int eth_bind(struct usb_composite_dev *cdev) 322 322 { 323 323 struct usb_gadget *gadget = cdev->gadget; 324 324 struct f_eem_opts *eem_opts = NULL; ··· 447 447 return status; 448 448 } 449 449 450 - static int __exit eth_unbind(struct usb_composite_dev *cdev) 450 + static int eth_unbind(struct usb_composite_dev *cdev) 451 451 { 452 452 if (has_rndis()) { 453 453 usb_put_function(f_rndis); ··· 466 466 return 0; 467 467 } 468 468 469 - static __refdata struct usb_composite_driver eth_driver = { 469 + static struct usb_composite_driver eth_driver = { 470 470 .name = "g_ether", 471 471 .dev = &device_desc, 472 472 .strings = dev_strings, 473 473 .max_speed = USB_SPEED_SUPER, 474 474 .bind = eth_bind, 475 - .unbind = __exit_p(eth_unbind), 475 + .unbind = eth_unbind, 476 476 }; 477 477 478 478 module_usb_composite_driver(eth_driver);
+1 -1
drivers/usb/gadget/legacy/g_ffs.c
··· 163 163 static int gfs_do_config(struct usb_configuration *c); 164 164 165 165 166 - static __refdata struct usb_composite_driver gfs_driver = { 166 + static struct usb_composite_driver gfs_driver = { 167 167 .name = DRIVER_NAME, 168 168 .dev = &gfs_dev_desc, 169 169 .strings = gfs_dev_strings,
+5 -5
drivers/usb/gadget/legacy/gmidi.c
··· 118 118 static struct usb_function_instance *fi_midi; 119 119 static struct usb_function *f_midi; 120 120 121 - static int __exit midi_unbind(struct usb_composite_dev *dev) 121 + static int midi_unbind(struct usb_composite_dev *dev) 122 122 { 123 123 usb_put_function(f_midi); 124 124 usb_put_function_instance(fi_midi); ··· 133 133 .MaxPower = CONFIG_USB_GADGET_VBUS_DRAW, 134 134 }; 135 135 136 - static int __init midi_bind_config(struct usb_configuration *c) 136 + static int midi_bind_config(struct usb_configuration *c) 137 137 { 138 138 int status; 139 139 ··· 150 150 return 0; 151 151 } 152 152 153 - static int __init midi_bind(struct usb_composite_dev *cdev) 153 + static int midi_bind(struct usb_composite_dev *cdev) 154 154 { 155 155 struct f_midi_opts *midi_opts; 156 156 int status; ··· 185 185 return status; 186 186 } 187 187 188 - static __refdata struct usb_composite_driver midi_driver = { 188 + static struct usb_composite_driver midi_driver = { 189 189 .name = (char *) longname, 190 190 .dev = &device_desc, 191 191 .strings = dev_strings, 192 192 .max_speed = USB_SPEED_HIGH, 193 193 .bind = midi_bind, 194 - .unbind = __exit_p(midi_unbind), 194 + .unbind = midi_unbind, 195 195 }; 196 196 197 197 module_usb_composite_driver(midi_driver);
+6 -6
drivers/usb/gadget/legacy/hid.c
··· 106 106 107 107 /****************************** Configurations ******************************/ 108 108 109 - static int __init do_config(struct usb_configuration *c) 109 + static int do_config(struct usb_configuration *c) 110 110 { 111 111 struct hidg_func_node *e, *n; 112 112 int status = 0; ··· 147 147 148 148 /****************************** Gadget Bind ******************************/ 149 149 150 - static int __init hid_bind(struct usb_composite_dev *cdev) 150 + static int hid_bind(struct usb_composite_dev *cdev) 151 151 { 152 152 struct usb_gadget *gadget = cdev->gadget; 153 153 struct list_head *tmp; ··· 205 205 return status; 206 206 } 207 207 208 - static int __exit hid_unbind(struct usb_composite_dev *cdev) 208 + static int hid_unbind(struct usb_composite_dev *cdev) 209 209 { 210 210 struct hidg_func_node *n; 211 211 ··· 216 216 return 0; 217 217 } 218 218 219 - static int __init hidg_plat_driver_probe(struct platform_device *pdev) 219 + static int hidg_plat_driver_probe(struct platform_device *pdev) 220 220 { 221 221 struct hidg_func_descriptor *func = dev_get_platdata(&pdev->dev); 222 222 struct hidg_func_node *entry; ··· 252 252 /****************************** Some noise ******************************/ 253 253 254 254 255 - static __refdata struct usb_composite_driver hidg_driver = { 255 + static struct usb_composite_driver hidg_driver = { 256 256 .name = "g_hid", 257 257 .dev = &device_desc, 258 258 .strings = dev_strings, 259 259 .max_speed = USB_SPEED_HIGH, 260 260 .bind = hid_bind, 261 - .unbind = __exit_p(hid_unbind), 261 + .unbind = hid_unbind, 262 262 }; 263 263 264 264 static struct platform_driver hidg_plat_driver = {
+3 -3
drivers/usb/gadget/legacy/mass_storage.c
··· 130 130 return 0; 131 131 } 132 132 133 - static int __init msg_do_config(struct usb_configuration *c) 133 + static int msg_do_config(struct usb_configuration *c) 134 134 { 135 135 struct fsg_opts *opts; 136 136 int ret; ··· 170 170 171 171 /****************************** Gadget Bind ******************************/ 172 172 173 - static int __init msg_bind(struct usb_composite_dev *cdev) 173 + static int msg_bind(struct usb_composite_dev *cdev) 174 174 { 175 175 static const struct fsg_operations ops = { 176 176 .thread_exits = msg_thread_exits, ··· 248 248 249 249 /****************************** Some noise ******************************/ 250 250 251 - static __refdata struct usb_composite_driver msg_driver = { 251 + static struct usb_composite_driver msg_driver = { 252 252 .name = "g_mass_storage", 253 253 .dev = &msg_device_desc, 254 254 .max_speed = USB_SPEED_SUPER,
+5 -5
drivers/usb/gadget/legacy/multi.c
··· 149 149 static struct usb_function *f_rndis; 150 150 static struct usb_function *f_msg_rndis; 151 151 152 - static __init int rndis_do_config(struct usb_configuration *c) 152 + static int rndis_do_config(struct usb_configuration *c) 153 153 { 154 154 struct fsg_opts *fsg_opts; 155 155 int ret; ··· 237 237 static struct usb_function *f_ecm; 238 238 static struct usb_function *f_msg_multi; 239 239 240 - static __init int cdc_do_config(struct usb_configuration *c) 240 + static int cdc_do_config(struct usb_configuration *c) 241 241 { 242 242 struct fsg_opts *fsg_opts; 243 243 int ret; ··· 466 466 return status; 467 467 } 468 468 469 - static int __exit multi_unbind(struct usb_composite_dev *cdev) 469 + static int multi_unbind(struct usb_composite_dev *cdev) 470 470 { 471 471 #ifdef CONFIG_USB_G_MULTI_CDC 472 472 usb_put_function(f_msg_multi); ··· 497 497 /****************************** Some noise ******************************/ 498 498 499 499 500 - static __refdata struct usb_composite_driver multi_driver = { 500 + static struct usb_composite_driver multi_driver = { 501 501 .name = "g_multi", 502 502 .dev = &device_desc, 503 503 .strings = dev_strings, 504 504 .max_speed = USB_SPEED_HIGH, 505 505 .bind = multi_bind, 506 - .unbind = __exit_p(multi_unbind), 506 + .unbind = multi_unbind, 507 507 .needs_serial = 1, 508 508 }; 509 509
+5 -5
drivers/usb/gadget/legacy/ncm.c
··· 107 107 108 108 /*-------------------------------------------------------------------------*/ 109 109 110 - static int __init ncm_do_config(struct usb_configuration *c) 110 + static int ncm_do_config(struct usb_configuration *c) 111 111 { 112 112 int status; 113 113 ··· 143 143 144 144 /*-------------------------------------------------------------------------*/ 145 145 146 - static int __init gncm_bind(struct usb_composite_dev *cdev) 146 + static int gncm_bind(struct usb_composite_dev *cdev) 147 147 { 148 148 struct usb_gadget *gadget = cdev->gadget; 149 149 struct f_ncm_opts *ncm_opts; ··· 186 186 return status; 187 187 } 188 188 189 - static int __exit gncm_unbind(struct usb_composite_dev *cdev) 189 + static int gncm_unbind(struct usb_composite_dev *cdev) 190 190 { 191 191 if (!IS_ERR_OR_NULL(f_ncm)) 192 192 usb_put_function(f_ncm); ··· 195 195 return 0; 196 196 } 197 197 198 - static __refdata struct usb_composite_driver ncm_driver = { 198 + static struct usb_composite_driver ncm_driver = { 199 199 .name = "g_ncm", 200 200 .dev = &device_desc, 201 201 .strings = dev_strings, 202 202 .max_speed = USB_SPEED_HIGH, 203 203 .bind = gncm_bind, 204 - .unbind = __exit_p(gncm_unbind), 204 + .unbind = gncm_unbind, 205 205 }; 206 206 207 207 module_usb_composite_driver(ncm_driver);
+5 -5
drivers/usb/gadget/legacy/nokia.c
··· 118 118 static struct usb_function_instance *fi_obex2; 119 119 static struct usb_function_instance *fi_phonet; 120 120 121 - static int __init nokia_bind_config(struct usb_configuration *c) 121 + static int nokia_bind_config(struct usb_configuration *c) 122 122 { 123 123 struct usb_function *f_acm; 124 124 struct usb_function *f_phonet = NULL; ··· 224 224 return status; 225 225 } 226 226 227 - static int __init nokia_bind(struct usb_composite_dev *cdev) 227 + static int nokia_bind(struct usb_composite_dev *cdev) 228 228 { 229 229 struct usb_gadget *gadget = cdev->gadget; 230 230 int status; ··· 307 307 return status; 308 308 } 309 309 310 - static int __exit nokia_unbind(struct usb_composite_dev *cdev) 310 + static int nokia_unbind(struct usb_composite_dev *cdev) 311 311 { 312 312 if (!IS_ERR_OR_NULL(f_obex1_cfg2)) 313 313 usb_put_function(f_obex1_cfg2); ··· 338 338 return 0; 339 339 } 340 340 341 - static __refdata struct usb_composite_driver nokia_driver = { 341 + static struct usb_composite_driver nokia_driver = { 342 342 .name = "g_nokia", 343 343 .dev = &device_desc, 344 344 .strings = dev_strings, 345 345 .max_speed = USB_SPEED_HIGH, 346 346 .bind = nokia_bind, 347 - .unbind = __exit_p(nokia_unbind), 347 + .unbind = nokia_unbind, 348 348 }; 349 349 350 350 module_usb_composite_driver(nokia_driver);
+4 -4
drivers/usb/gadget/legacy/printer.c
··· 126 126 .bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER, 127 127 }; 128 128 129 - static int __init printer_do_config(struct usb_configuration *c) 129 + static int printer_do_config(struct usb_configuration *c) 130 130 { 131 131 struct usb_gadget *gadget = c->cdev->gadget; 132 132 int status = 0; ··· 152 152 return status; 153 153 } 154 154 155 - static int __init printer_bind(struct usb_composite_dev *cdev) 155 + static int printer_bind(struct usb_composite_dev *cdev) 156 156 { 157 157 struct f_printer_opts *opts; 158 158 int ret, len; ··· 191 191 return ret; 192 192 } 193 193 194 - static int __exit printer_unbind(struct usb_composite_dev *cdev) 194 + static int printer_unbind(struct usb_composite_dev *cdev) 195 195 { 196 196 usb_put_function(f_printer); 197 197 usb_put_function_instance(fi_printer); ··· 199 199 return 0; 200 200 } 201 201 202 - static __refdata struct usb_composite_driver printer_driver = { 202 + static struct usb_composite_driver printer_driver = { 203 203 .name = shortname, 204 204 .dev = &device_desc, 205 205 .strings = dev_strings,
+2 -2
drivers/usb/gadget/legacy/serial.c
··· 174 174 return ret; 175 175 } 176 176 177 - static int __init gs_bind(struct usb_composite_dev *cdev) 177 + static int gs_bind(struct usb_composite_dev *cdev) 178 178 { 179 179 int status; 180 180 ··· 230 230 return 0; 231 231 } 232 232 233 - static __refdata struct usb_composite_driver gserial_driver = { 233 + static struct usb_composite_driver gserial_driver = { 234 234 .name = "g_serial", 235 235 .dev = &device_desc, 236 236 .strings = dev_strings,
+1 -1
drivers/usb/gadget/legacy/tcm_usb_gadget.c
··· 2397 2397 return 0; 2398 2398 } 2399 2399 2400 - static __refdata struct usb_composite_driver usbg_driver = { 2400 + static struct usb_composite_driver usbg_driver = { 2401 2401 .name = "g_target", 2402 2402 .dev = &usbg_device_desc, 2403 2403 .strings = usbg_strings,
+4 -4
drivers/usb/gadget/legacy/webcam.c
··· 334 334 * USB configuration 335 335 */ 336 336 337 - static int __init 337 + static int 338 338 webcam_config_bind(struct usb_configuration *c) 339 339 { 340 340 int status = 0; ··· 358 358 .MaxPower = CONFIG_USB_GADGET_VBUS_DRAW, 359 359 }; 360 360 361 - static int /* __init_or_exit */ 361 + static int 362 362 webcam_unbind(struct usb_composite_dev *cdev) 363 363 { 364 364 if (!IS_ERR_OR_NULL(f_uvc)) ··· 368 368 return 0; 369 369 } 370 370 371 - static int __init 371 + static int 372 372 webcam_bind(struct usb_composite_dev *cdev) 373 373 { 374 374 struct f_uvc_opts *uvc_opts; ··· 422 422 * Driver 423 423 */ 424 424 425 - static __refdata struct usb_composite_driver webcam_driver = { 425 + static struct usb_composite_driver webcam_driver = { 426 426 .name = "g_webcam", 427 427 .dev = &webcam_device_descriptor, 428 428 .strings = webcam_device_strings,
+2 -2
drivers/usb/gadget/legacy/zero.c
··· 272 272 module_param_named(qlen, gzero_options.qlen, uint, S_IRUGO|S_IWUSR); 273 273 MODULE_PARM_DESC(qlen, "depth of loopback queue"); 274 274 275 - static int __init zero_bind(struct usb_composite_dev *cdev) 275 + static int zero_bind(struct usb_composite_dev *cdev) 276 276 { 277 277 struct f_ss_opts *ss_opts; 278 278 struct f_lb_opts *lb_opts; ··· 400 400 return 0; 401 401 } 402 402 403 - static __refdata struct usb_composite_driver zero_driver = { 403 + static struct usb_composite_driver zero_driver = { 404 404 .name = "zero", 405 405 .dev = &device_desc, 406 406 .strings = dev_strings,
+2 -2
drivers/usb/gadget/udc/at91_udc.c
··· 1942 1942 return retval; 1943 1943 } 1944 1944 1945 - static int __exit at91udc_remove(struct platform_device *pdev) 1945 + static int at91udc_remove(struct platform_device *pdev) 1946 1946 { 1947 1947 struct at91_udc *udc = platform_get_drvdata(pdev); 1948 1948 unsigned long flags; ··· 2018 2018 #endif 2019 2019 2020 2020 static struct platform_driver at91_udc_driver = { 2021 - .remove = __exit_p(at91udc_remove), 2021 + .remove = at91udc_remove, 2022 2022 .shutdown = at91udc_shutdown, 2023 2023 .suspend = at91udc_suspend, 2024 2024 .resume = at91udc_resume,
+2 -2
drivers/usb/gadget/udc/atmel_usba_udc.c
··· 2186 2186 return 0; 2187 2187 } 2188 2188 2189 - static int __exit usba_udc_remove(struct platform_device *pdev) 2189 + static int usba_udc_remove(struct platform_device *pdev) 2190 2190 { 2191 2191 struct usba_udc *udc; 2192 2192 int i; ··· 2258 2258 static SIMPLE_DEV_PM_OPS(usba_udc_pm_ops, usba_udc_suspend, usba_udc_resume); 2259 2259 2260 2260 static struct platform_driver udc_driver = { 2261 - .remove = __exit_p(usba_udc_remove), 2261 + .remove = usba_udc_remove, 2262 2262 .driver = { 2263 2263 .name = "atmel_usba_udc", 2264 2264 .pm = &usba_udc_pm_ops,
+2 -2
drivers/usb/gadget/udc/fsl_udc_core.c
··· 2525 2525 /* Driver removal function 2526 2526 * Free resources and finish pending transactions 2527 2527 */ 2528 - static int __exit fsl_udc_remove(struct platform_device *pdev) 2528 + static int fsl_udc_remove(struct platform_device *pdev) 2529 2529 { 2530 2530 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 2531 2531 struct fsl_usb2_platform_data *pdata = dev_get_platdata(&pdev->dev); ··· 2663 2663 }; 2664 2664 MODULE_DEVICE_TABLE(platform, fsl_udc_devtype); 2665 2665 static struct platform_driver udc_driver = { 2666 - .remove = __exit_p(fsl_udc_remove), 2666 + .remove = fsl_udc_remove, 2667 2667 /* Just for FSL i.mx SoC currently */ 2668 2668 .id_table = fsl_udc_devtype, 2669 2669 /* these suspend and resume are not usb suspend and resume */
+2 -2
drivers/usb/gadget/udc/fusb300_udc.c
··· 1342 1342 .udc_stop = fusb300_udc_stop, 1343 1343 }; 1344 1344 1345 - static int __exit fusb300_remove(struct platform_device *pdev) 1345 + static int fusb300_remove(struct platform_device *pdev) 1346 1346 { 1347 1347 struct fusb300 *fusb300 = platform_get_drvdata(pdev); 1348 1348 ··· 1492 1492 } 1493 1493 1494 1494 static struct platform_driver fusb300_driver = { 1495 - .remove = __exit_p(fusb300_remove), 1495 + .remove = fusb300_remove, 1496 1496 .driver = { 1497 1497 .name = (char *) udc_name, 1498 1498 },
+2 -2
drivers/usb/gadget/udc/m66592-udc.c
··· 1528 1528 .pullup = m66592_pullup, 1529 1529 }; 1530 1530 1531 - static int __exit m66592_remove(struct platform_device *pdev) 1531 + static int m66592_remove(struct platform_device *pdev) 1532 1532 { 1533 1533 struct m66592 *m66592 = platform_get_drvdata(pdev); 1534 1534 ··· 1695 1695 1696 1696 /*-------------------------------------------------------------------------*/ 1697 1697 static struct platform_driver m66592_driver = { 1698 - .remove = __exit_p(m66592_remove), 1698 + .remove = m66592_remove, 1699 1699 .driver = { 1700 1700 .name = (char *) udc_name, 1701 1701 },
+2 -2
drivers/usb/gadget/udc/r8a66597-udc.c
··· 1820 1820 .set_selfpowered = r8a66597_set_selfpowered, 1821 1821 }; 1822 1822 1823 - static int __exit r8a66597_remove(struct platform_device *pdev) 1823 + static int r8a66597_remove(struct platform_device *pdev) 1824 1824 { 1825 1825 struct r8a66597 *r8a66597 = platform_get_drvdata(pdev); 1826 1826 ··· 1974 1974 1975 1975 /*-------------------------------------------------------------------------*/ 1976 1976 static struct platform_driver r8a66597_driver = { 1977 - .remove = __exit_p(r8a66597_remove), 1977 + .remove = r8a66597_remove, 1978 1978 .driver = { 1979 1979 .name = (char *) udc_name, 1980 1980 },
+2 -2
drivers/usb/gadget/udc/udc-xilinx.c
··· 2071 2071 /* Map the registers */ 2072 2072 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 2073 2073 udc->addr = devm_ioremap_resource(&pdev->dev, res); 2074 - if (!udc->addr) 2075 - return -ENOMEM; 2074 + if (IS_ERR(udc->addr)) 2075 + return PTR_ERR(udc->addr); 2076 2076 2077 2077 irq = platform_get_irq(pdev, 0); 2078 2078 if (irq < 0) {
+6 -1
drivers/usb/host/xhci-ring.c
··· 2026 2026 break; 2027 2027 case COMP_DEV_ERR: 2028 2028 case COMP_STALL: 2029 + frame->status = -EPROTO; 2030 + skip_td = true; 2031 + break; 2029 2032 case COMP_TX_ERR: 2030 2033 frame->status = -EPROTO; 2034 + if (event_trb != td->last_trb) 2035 + return 0; 2031 2036 skip_td = true; 2032 2037 break; 2033 2038 case COMP_STOP: ··· 2645 2640 xhci_halt(xhci); 2646 2641 hw_died: 2647 2642 spin_unlock(&xhci->lock); 2648 - return -ESHUTDOWN; 2643 + return IRQ_HANDLED; 2649 2644 } 2650 2645 2651 2646 /*
+1 -1
drivers/usb/host/xhci.h
··· 1267 1267 * since the command ring is 64-byte aligned. 1268 1268 * It must also be greater than 16. 1269 1269 */ 1270 - #define TRBS_PER_SEGMENT 64 1270 + #define TRBS_PER_SEGMENT 256 1271 1271 /* Allow two commands + a link TRB, along with any reserved command TRBs */ 1272 1272 #define MAX_RSVD_CMD_TRBS (TRBS_PER_SEGMENT - 3) 1273 1273 #define TRB_SEGMENT_SIZE (TRBS_PER_SEGMENT*16)
+1 -1
drivers/usb/phy/phy-isp1301-omap.c
··· 94 94 95 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 99 #include <linux/i2c/tps65010.h> 100 100
+1
drivers/usb/serial/cp210x.c
··· 127 127 { USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */ 128 128 { USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */ 129 129 { USB_DEVICE(0x10C4, 0x8977) }, /* CEL MeshWorks DevKit Device */ 130 + { USB_DEVICE(0x10C4, 0x8998) }, /* KCF Technologies PRN */ 130 131 { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ 131 132 { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ 132 133 { USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */
-1
drivers/usb/serial/pl2303.c
··· 61 61 { USB_DEVICE(DCU10_VENDOR_ID, DCU10_PRODUCT_ID) }, 62 62 { USB_DEVICE(SITECOM_VENDOR_ID, SITECOM_PRODUCT_ID) }, 63 63 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_ID) }, 64 - { USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_ID) }, 65 64 { USB_DEVICE(SIEMENS_VENDOR_ID, SIEMENS_PRODUCT_ID_SX1), 66 65 .driver_info = PL2303_QUIRK_UART_STATE_IDX0 }, 67 66 { USB_DEVICE(SIEMENS_VENDOR_ID, SIEMENS_PRODUCT_ID_X65),
-4
drivers/usb/serial/pl2303.h
··· 62 62 #define ALCATEL_VENDOR_ID 0x11f7 63 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 65 #define SIEMENS_VENDOR_ID 0x11f5 70 66 #define SIEMENS_PRODUCT_ID_SX1 0x0001 71 67 #define SIEMENS_PRODUCT_ID_X65 0x0003
+1 -1
drivers/usb/serial/visor.c
··· 95 95 .driver_info = (kernel_ulong_t)&palm_os_4_probe }, 96 96 { USB_DEVICE(ACER_VENDOR_ID, ACER_S10_ID), 97 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 99 .driver_info = (kernel_ulong_t)&palm_os_4_probe }, 100 100 { USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_SPH_I500_ID), 101 101 .driver_info = (kernel_ulong_t)&palm_os_4_probe },
+7
drivers/usb/storage/unusual_devs.h
··· 766 766 USB_SC_DEVICE, USB_PR_DEVICE, NULL, 767 767 US_FL_GO_SLOW ), 768 768 769 + /* Reported by Christian Schaller <cschalle@redhat.com> */ 770 + UNUSUAL_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 776 /* Submitted by Joel Bourquard <numlock@freesurf.ch> 770 777 * Some versions of this device need the SubClass and Protocol overrides 771 778 * while others don't.