hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/usb/gadget/udc/aspeed-vhub/epn.c
....@@ -120,7 +120,7 @@
120120 /* No current DMA ongoing */
121121 req->active = false;
122122
123
- /* Grab lenght out of HW */
123
+ /* Grab length out of HW */
124124 len = VHUB_EP_DMA_TX_SIZE(stat);
125125
126126 /* If not using DMA, copy data out if needed */
....@@ -352,8 +352,8 @@
352352
353353 /* Endpoint enabled ? */
354354 if (!ep->epn.enabled || !u_ep->desc || !ep->dev || !ep->d_idx ||
355
- !ep->dev->enabled || ep->dev->suspended) {
356
- EPDBG(ep,"Enqueing request on wrong or disabled EP\n");
355
+ !ep->dev->enabled) {
356
+ EPDBG(ep, "Enqueuing request on wrong or disabled EP\n");
357357 return -ESHUTDOWN;
358358 }
359359
....@@ -596,10 +596,6 @@
596596 static int ast_vhub_epn_enable(struct usb_ep* u_ep,
597597 const struct usb_endpoint_descriptor *desc)
598598 {
599
- static const char *ep_type_string[] __maybe_unused = { "ctrl",
600
- "isoc",
601
- "bulk",
602
- "intr" };
603599 struct ast_vhub_ep *ep = to_ast_ep(u_ep);
604600 struct ast_vhub_dev *dev;
605601 struct ast_vhub *vhub;
....@@ -649,7 +645,7 @@
649645 ep->epn.wedged = false;
650646
651647 EPDBG(ep, "Enabling [%s] %s num %d maxpacket=%d\n",
652
- ep->epn.is_in ? "in" : "out", ep_type_string[type],
648
+ ep->epn.is_in ? "in" : "out", usb_ep_type_string(type),
653649 usb_endpoint_num(desc), maxpacket);
654650
655651 /* Can we use DMA descriptor mode ? */
....@@ -807,10 +803,10 @@
807803
808804 /* Find a free one (no device) */
809805 spin_lock_irqsave(&vhub->lock, flags);
810
- for (i = 0; i < AST_VHUB_NUM_GEN_EPs; i++)
806
+ for (i = 0; i < vhub->max_epns; i++)
811807 if (vhub->epns[i].dev == NULL)
812808 break;
813
- if (i >= AST_VHUB_NUM_GEN_EPs) {
809
+ if (i >= vhub->max_epns) {
814810 spin_unlock_irqrestore(&vhub->lock, flags);
815811 return NULL;
816812 }