diff options
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/fsl_qe_udc.c | 19 | ||||
-rw-r--r-- | drivers/usb/gadget/fsl_qe_udc.h | 1 |
2 files changed, 9 insertions, 11 deletions
diff --git a/drivers/usb/gadget/fsl_qe_udc.c b/drivers/usb/gadget/fsl_qe_udc.c index 877a2c46672b..26cf99320188 100644 --- a/drivers/usb/gadget/fsl_qe_udc.c +++ b/drivers/usb/gadget/fsl_qe_udc.c | |||
@@ -489,10 +489,10 @@ static int qe_ep_register_init(struct qe_udc *udc, unsigned char pipe_num) | |||
489 | epparam = udc->ep_param[pipe_num]; | 489 | epparam = udc->ep_param[pipe_num]; |
490 | 490 | ||
491 | usep = 0; | 491 | usep = 0; |
492 | logepnum = (ep->desc->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK); | 492 | logepnum = (ep->ep.desc->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK); |
493 | usep |= (logepnum << USB_EPNUM_SHIFT); | 493 | usep |= (logepnum << USB_EPNUM_SHIFT); |
494 | 494 | ||
495 | switch (ep->desc->bmAttributes & 0x03) { | 495 | switch (ep->ep.desc->bmAttributes & 0x03) { |
496 | case USB_ENDPOINT_XFER_BULK: | 496 | case USB_ENDPOINT_XFER_BULK: |
497 | usep |= USB_TRANS_BULK; | 497 | usep |= USB_TRANS_BULK; |
498 | break; | 498 | break; |
@@ -644,7 +644,7 @@ static int qe_ep_init(struct qe_udc *udc, | |||
644 | /* initialize ep structure */ | 644 | /* initialize ep structure */ |
645 | ep->ep.maxpacket = max; | 645 | ep->ep.maxpacket = max; |
646 | ep->tm = (u8)(desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK); | 646 | ep->tm = (u8)(desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK); |
647 | ep->desc = desc; | 647 | ep->ep.desc = desc; |
648 | ep->stopped = 0; | 648 | ep->stopped = 0; |
649 | ep->init = 1; | 649 | ep->init = 1; |
650 | 650 | ||
@@ -1599,7 +1599,7 @@ static int qe_ep_enable(struct usb_ep *_ep, | |||
1599 | ep = container_of(_ep, struct qe_ep, ep); | 1599 | ep = container_of(_ep, struct qe_ep, ep); |
1600 | 1600 | ||
1601 | /* catch various bogus parameters */ | 1601 | /* catch various bogus parameters */ |
1602 | if (!_ep || !desc || ep->desc || _ep->name == ep_name[0] || | 1602 | if (!_ep || !desc || ep->ep.desc || _ep->name == ep_name[0] || |
1603 | (desc->bDescriptorType != USB_DT_ENDPOINT)) | 1603 | (desc->bDescriptorType != USB_DT_ENDPOINT)) |
1604 | return -EINVAL; | 1604 | return -EINVAL; |
1605 | 1605 | ||
@@ -1629,7 +1629,7 @@ static int qe_ep_disable(struct usb_ep *_ep) | |||
1629 | ep = container_of(_ep, struct qe_ep, ep); | 1629 | ep = container_of(_ep, struct qe_ep, ep); |
1630 | udc = ep->udc; | 1630 | udc = ep->udc; |
1631 | 1631 | ||
1632 | if (!_ep || !ep->desc) { | 1632 | if (!_ep || !ep->ep.desc) { |
1633 | dev_dbg(udc->dev, "%s not enabled\n", _ep ? ep->ep.name : NULL); | 1633 | dev_dbg(udc->dev, "%s not enabled\n", _ep ? ep->ep.name : NULL); |
1634 | return -EINVAL; | 1634 | return -EINVAL; |
1635 | } | 1635 | } |
@@ -1637,7 +1637,6 @@ static int qe_ep_disable(struct usb_ep *_ep) | |||
1637 | spin_lock_irqsave(&udc->lock, flags); | 1637 | spin_lock_irqsave(&udc->lock, flags); |
1638 | /* Nuke all pending requests (does flush) */ | 1638 | /* Nuke all pending requests (does flush) */ |
1639 | nuke(ep, -ESHUTDOWN); | 1639 | nuke(ep, -ESHUTDOWN); |
1640 | ep->desc = NULL; | ||
1641 | ep->ep.desc = NULL; | 1640 | ep->ep.desc = NULL; |
1642 | ep->stopped = 1; | 1641 | ep->stopped = 1; |
1643 | ep->tx_req = NULL; | 1642 | ep->tx_req = NULL; |
@@ -1715,7 +1714,7 @@ static int __qe_ep_queue(struct usb_ep *_ep, struct usb_request *_req) | |||
1715 | dev_dbg(udc->dev, "bad params\n"); | 1714 | dev_dbg(udc->dev, "bad params\n"); |
1716 | return -EINVAL; | 1715 | return -EINVAL; |
1717 | } | 1716 | } |
1718 | if (!_ep || (!ep->desc && ep_index(ep))) { | 1717 | if (!_ep || (!ep->ep.desc && ep_index(ep))) { |
1719 | dev_dbg(udc->dev, "bad ep\n"); | 1718 | dev_dbg(udc->dev, "bad ep\n"); |
1720 | return -EINVAL; | 1719 | return -EINVAL; |
1721 | } | 1720 | } |
@@ -1826,7 +1825,7 @@ static int qe_ep_set_halt(struct usb_ep *_ep, int value) | |||
1826 | struct qe_udc *udc; | 1825 | struct qe_udc *udc; |
1827 | 1826 | ||
1828 | ep = container_of(_ep, struct qe_ep, ep); | 1827 | ep = container_of(_ep, struct qe_ep, ep); |
1829 | if (!_ep || !ep->desc) { | 1828 | if (!_ep || !ep->ep.desc) { |
1830 | status = -EINVAL; | 1829 | status = -EINVAL; |
1831 | goto out; | 1830 | goto out; |
1832 | } | 1831 | } |
@@ -2015,7 +2014,7 @@ static void ch9getstatus(struct qe_udc *udc, u8 request_type, u16 value, | |||
2015 | u16 usep; | 2014 | u16 usep; |
2016 | 2015 | ||
2017 | /* stall if endpoint doesn't exist */ | 2016 | /* stall if endpoint doesn't exist */ |
2018 | if (!target_ep->desc) | 2017 | if (!target_ep->ep.desc) |
2019 | goto stall; | 2018 | goto stall; |
2020 | 2019 | ||
2021 | usep = in_be16(&udc->usb_regs->usb_usep[pipe]); | 2020 | usep = in_be16(&udc->usb_regs->usb_usep[pipe]); |
@@ -2502,7 +2501,7 @@ static int __devinit qe_ep_config(struct qe_udc *udc, unsigned char pipe_num) | |||
2502 | ep->ep.ops = &qe_ep_ops; | 2501 | ep->ep.ops = &qe_ep_ops; |
2503 | ep->stopped = 1; | 2502 | ep->stopped = 1; |
2504 | ep->ep.maxpacket = (unsigned short) ~0; | 2503 | ep->ep.maxpacket = (unsigned short) ~0; |
2505 | ep->desc = NULL; | 2504 | ep->ep.desc = NULL; |
2506 | ep->dir = 0xff; | 2505 | ep->dir = 0xff; |
2507 | ep->epnum = (u8)pipe_num; | 2506 | ep->epnum = (u8)pipe_num; |
2508 | ep->sent = 0; | 2507 | ep->sent = 0; |
diff --git a/drivers/usb/gadget/fsl_qe_udc.h b/drivers/usb/gadget/fsl_qe_udc.h index 1da5fb03d218..4c07ca9cebf3 100644 --- a/drivers/usb/gadget/fsl_qe_udc.h +++ b/drivers/usb/gadget/fsl_qe_udc.h | |||
@@ -266,7 +266,6 @@ struct qe_ep { | |||
266 | struct usb_ep ep; | 266 | struct usb_ep ep; |
267 | struct list_head queue; | 267 | struct list_head queue; |
268 | struct qe_udc *udc; | 268 | struct qe_udc *udc; |
269 | const struct usb_endpoint_descriptor *desc; | ||
270 | struct usb_gadget *gadget; | 269 | struct usb_gadget *gadget; |
271 | 270 | ||
272 | u8 state; | 271 | u8 state; |