diff options
Diffstat (limited to 'drivers/usb/gadget/amd5536udc.c')
-rw-r--r-- | drivers/usb/gadget/amd5536udc.c | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c index 77779271f487..187d21181cd5 100644 --- a/drivers/usb/gadget/amd5536udc.c +++ b/drivers/usb/gadget/amd5536udc.c | |||
@@ -333,7 +333,7 @@ udc_ep_enable(struct usb_ep *usbep, const struct usb_endpoint_descriptor *desc) | |||
333 | return -ESHUTDOWN; | 333 | return -ESHUTDOWN; |
334 | 334 | ||
335 | spin_lock_irqsave(&dev->lock, iflags); | 335 | spin_lock_irqsave(&dev->lock, iflags); |
336 | ep->desc = desc; | 336 | ep->ep.desc = desc; |
337 | 337 | ||
338 | ep->halted = 0; | 338 | ep->halted = 0; |
339 | 339 | ||
@@ -442,7 +442,6 @@ static void ep_init(struct udc_regs __iomem *regs, struct udc_ep *ep) | |||
442 | u32 tmp; | 442 | u32 tmp; |
443 | 443 | ||
444 | VDBG(ep->dev, "ep-%d reset\n", ep->num); | 444 | VDBG(ep->dev, "ep-%d reset\n", ep->num); |
445 | ep->desc = NULL; | ||
446 | ep->ep.desc = NULL; | 445 | ep->ep.desc = NULL; |
447 | ep->ep.ops = &udc_ep_ops; | 446 | ep->ep.ops = &udc_ep_ops; |
448 | INIT_LIST_HEAD(&ep->queue); | 447 | INIT_LIST_HEAD(&ep->queue); |
@@ -489,7 +488,7 @@ static int udc_ep_disable(struct usb_ep *usbep) | |||
489 | return -EINVAL; | 488 | return -EINVAL; |
490 | 489 | ||
491 | ep = container_of(usbep, struct udc_ep, ep); | 490 | ep = container_of(usbep, struct udc_ep, ep); |
492 | if (usbep->name == ep0_string || !ep->desc) | 491 | if (usbep->name == ep0_string || !ep->ep.desc) |
493 | return -EINVAL; | 492 | return -EINVAL; |
494 | 493 | ||
495 | DBG(ep->dev, "Disable ep-%d\n", ep->num); | 494 | DBG(ep->dev, "Disable ep-%d\n", ep->num); |
@@ -1066,7 +1065,7 @@ udc_queue(struct usb_ep *usbep, struct usb_request *usbreq, gfp_t gfp) | |||
1066 | return -EINVAL; | 1065 | return -EINVAL; |
1067 | 1066 | ||
1068 | ep = container_of(usbep, struct udc_ep, ep); | 1067 | ep = container_of(usbep, struct udc_ep, ep); |
1069 | if (!ep->desc && (ep->num != 0 && ep->num != UDC_EP0OUT_IX)) | 1068 | if (!ep->ep.desc && (ep->num != 0 && ep->num != UDC_EP0OUT_IX)) |
1070 | return -EINVAL; | 1069 | return -EINVAL; |
1071 | 1070 | ||
1072 | VDBG(ep->dev, "udc_queue(): ep%d-in=%d\n", ep->num, ep->in); | 1071 | VDBG(ep->dev, "udc_queue(): ep%d-in=%d\n", ep->num, ep->in); |
@@ -1257,7 +1256,7 @@ static int udc_dequeue(struct usb_ep *usbep, struct usb_request *usbreq) | |||
1257 | unsigned long iflags; | 1256 | unsigned long iflags; |
1258 | 1257 | ||
1259 | ep = container_of(usbep, struct udc_ep, ep); | 1258 | ep = container_of(usbep, struct udc_ep, ep); |
1260 | if (!usbep || !usbreq || (!ep->desc && (ep->num != 0 | 1259 | if (!usbep || !usbreq || (!ep->ep.desc && (ep->num != 0 |
1261 | && ep->num != UDC_EP0OUT_IX))) | 1260 | && ep->num != UDC_EP0OUT_IX))) |
1262 | return -EINVAL; | 1261 | return -EINVAL; |
1263 | 1262 | ||
@@ -1317,7 +1316,7 @@ udc_set_halt(struct usb_ep *usbep, int halt) | |||
1317 | pr_debug("set_halt %s: halt=%d\n", usbep->name, halt); | 1316 | pr_debug("set_halt %s: halt=%d\n", usbep->name, halt); |
1318 | 1317 | ||
1319 | ep = container_of(usbep, struct udc_ep, ep); | 1318 | ep = container_of(usbep, struct udc_ep, ep); |
1320 | if (!ep->desc && (ep->num != 0 && ep->num != UDC_EP0OUT_IX)) | 1319 | if (!ep->ep.desc && (ep->num != 0 && ep->num != UDC_EP0OUT_IX)) |
1321 | return -EINVAL; | 1320 | return -EINVAL; |
1322 | if (!ep->dev->driver || ep->dev->gadget.speed == USB_SPEED_UNKNOWN) | 1321 | if (!ep->dev->driver || ep->dev->gadget.speed == USB_SPEED_UNKNOWN) |
1323 | return -ESHUTDOWN; | 1322 | return -ESHUTDOWN; |
@@ -1539,7 +1538,7 @@ static void udc_setup_endpoints(struct udc *dev) | |||
1539 | * disabling ep interrupts when ENUM interrupt occurs but ep is | 1538 | * disabling ep interrupts when ENUM interrupt occurs but ep is |
1540 | * not enabled by gadget driver | 1539 | * not enabled by gadget driver |
1541 | */ | 1540 | */ |
1542 | if (!ep->desc) | 1541 | if (!ep->ep.desc) |
1543 | ep_init(dev->regs, ep); | 1542 | ep_init(dev->regs, ep); |
1544 | 1543 | ||
1545 | if (use_dma) { | 1544 | if (use_dma) { |
@@ -3402,19 +3401,7 @@ static struct pci_driver udc_pci_driver = { | |||
3402 | .remove = udc_pci_remove, | 3401 | .remove = udc_pci_remove, |
3403 | }; | 3402 | }; |
3404 | 3403 | ||
3405 | /* Inits driver */ | 3404 | module_pci_driver(udc_pci_driver); |
3406 | static int __init init(void) | ||
3407 | { | ||
3408 | return pci_register_driver(&udc_pci_driver); | ||
3409 | } | ||
3410 | module_init(init); | ||
3411 | |||
3412 | /* Cleans driver */ | ||
3413 | static void __exit cleanup(void) | ||
3414 | { | ||
3415 | pci_unregister_driver(&udc_pci_driver); | ||
3416 | } | ||
3417 | module_exit(cleanup); | ||
3418 | 3405 | ||
3419 | MODULE_DESCRIPTION(UDC_MOD_DESCRIPTION); | 3406 | MODULE_DESCRIPTION(UDC_MOD_DESCRIPTION); |
3420 | MODULE_AUTHOR("Thomas Dahlmann"); | 3407 | MODULE_AUTHOR("Thomas Dahlmann"); |