Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: gadget: Update goku_udc to use usb_endpoint_descriptor inside the struct usb_ep

Remove redundant pointer to struct usb_endpoint_descriptor.

Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>

authored by

Ido Shayevitz and committed by
Felipe Balbi
db79d981 fab1137f

+10 -11
+10 -10
drivers/usb/gadget/goku_udc.c
··· 102 102 unsigned long flags; 103 103 104 104 ep = container_of(_ep, struct goku_ep, ep); 105 - if (!_ep || !desc || ep->desc 105 + if (!_ep || !desc || ep->ep.desc 106 106 || desc->bDescriptorType != USB_DT_ENDPOINT) 107 107 return -EINVAL; 108 108 dev = ep->dev; ··· 176 176 command(ep->dev->regs, COMMAND_RESET, ep->num); 177 177 ep->ep.maxpacket = max; 178 178 ep->stopped = 0; 179 - ep->desc = desc; 179 + ep->ep.desc = desc; 180 180 spin_unlock_irqrestore(&ep->dev->lock, flags); 181 181 182 182 DBG(dev, "enable %s %s %s maxpacket %u\n", ep->ep.name, ··· 233 233 } 234 234 235 235 ep->ep.maxpacket = MAX_FIFO_SIZE; 236 - ep->desc = NULL; 237 236 ep->ep.desc = NULL; 238 237 ep->stopped = 1; 239 238 ep->irqs = 0; ··· 246 247 unsigned long flags; 247 248 248 249 ep = container_of(_ep, struct goku_ep, ep); 249 - if (!_ep || !ep->desc) 250 + if (!_ep || !ep->ep.desc) 250 251 return -ENODEV; 251 252 dev = ep->dev; 252 253 if (dev->ep0state == EP0_SUSPEND) ··· 721 722 || !_req->buf || !list_empty(&req->queue))) 722 723 return -EINVAL; 723 724 ep = container_of(_ep, struct goku_ep, ep); 724 - if (unlikely(!_ep || (!ep->desc && ep->num != 0))) 725 + if (unlikely(!_ep || (!ep->ep.desc && ep->num != 0))) 725 726 return -EINVAL; 726 727 dev = ep->dev; 727 728 if (unlikely(!dev->driver || dev->gadget.speed == USB_SPEED_UNKNOWN)) ··· 814 815 unsigned long flags; 815 816 816 817 ep = container_of(_ep, struct goku_ep, ep); 817 - if (!_ep || !_req || (!ep->desc && ep->num != 0)) 818 + if (!_ep || !_req || (!ep->ep.desc && ep->num != 0)) 818 819 return -EINVAL; 819 820 dev = ep->dev; 820 821 if (!dev->driver) ··· 895 896 return -EINVAL; 896 897 897 898 /* don't change EPxSTATUS_EP_INVALID to READY */ 898 - } else if (!ep->desc) { 899 + } else if (!ep->ep.desc) { 899 900 DBG(ep->dev, "%s %s inactive?\n", __func__, ep->ep.name); 900 901 return -EINVAL; 901 902 } ··· 954 955 VDBG(ep->dev, "%s %s\n", __func__, ep->ep.name); 955 956 956 957 /* don't change EPxSTATUS_EP_INVALID to READY */ 957 - if (!ep->desc && ep->num != 0) { 958 + if (!ep->ep.desc && ep->num != 0) { 958 959 DBG(ep->dev, "%s %s inactive?\n", __func__, ep->ep.name); 959 960 return; 960 961 } ··· 1151 1152 struct goku_ep *ep = &dev->ep [i]; 1152 1153 struct goku_request *req; 1153 1154 1154 - if (i && !ep->desc) 1155 + if (i && !ep->ep.desc) 1155 1156 continue; 1156 1157 1157 1158 tmp = readl(ep->reg_status); ··· 1472 1473 case USB_RECIP_ENDPOINT: 1473 1474 tmp = le16_to_cpu(ctrl.wIndex) & 0x0f; 1474 1475 /* active endpoint */ 1475 - if (tmp > 3 || (!dev->ep[tmp].desc && tmp != 0)) 1476 + if (tmp > 3 || 1477 + (!dev->ep[tmp].ep.desc && tmp != 0)) 1476 1478 goto stall; 1477 1479 if (ctrl.wIndex & cpu_to_le16( 1478 1480 USB_DIR_IN)) {
-1
drivers/usb/gadget/goku_udc.h
··· 216 216 217 217 /* analogous to a host-side qh */ 218 218 struct list_head queue; 219 - const struct usb_endpoint_descriptor *desc; 220 219 221 220 u32 __iomem *reg_fifo; 222 221 u32 __iomem *reg_mode;