[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1345450306-4996-2-git-send-email-stigge@antcom.de>
Date: Mon, 20 Aug 2012 10:11:45 +0200
From: Roland Stigge <stigge@...com.de>
To: bigeasy@...utronix.de, balbi@...com, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org, gregkh@...uxfoundation.org,
arnd@...db.de, aletes.xgr@...il.com, kevin.wells@....com,
srinivas.bakki@....com
Cc: Roland Stigge <stigge@...com.de>
Subject: [PATCH 2/3] usb: gadget: lpc32xx_udc: Remove usb_endpoint_descriptor
This patch removes the utilization of struct usb_endpoint_descriptor, as done
by other drivers also. This was done on request by the USB gadget maintainers,
since this API is obsoleted.
Signed-off-by: Roland Stigge <stigge@...com.de>
---
drivers/usb/gadget/lpc32xx_udc.c | 23 +++++++----------------
1 file changed, 7 insertions(+), 16 deletions(-)
--- linux-2.6.orig/drivers/usb/gadget/lpc32xx_udc.c
+++ linux-2.6/drivers/usb/gadget/lpc32xx_udc.c
@@ -141,8 +141,6 @@ struct lpc32xx_ep {
u32 totalints;
bool wedge;
-
- const struct usb_endpoint_descriptor *desc;
};
/*
@@ -556,10 +554,8 @@ static int proc_udc_show(struct seq_file
if (udc->enabled && udc->vbus) {
proc_ep_show(s, &udc->ep[0]);
- list_for_each_entry(ep, &udc->gadget.ep_list, ep.ep_list) {
- if (ep->desc)
- proc_ep_show(s, ep);
- }
+ list_for_each_entry(ep, &udc->gadget.ep_list, ep.ep_list)
+ proc_ep_show(s, ep);
}
spin_unlock_irqrestore(&udc->lock, flags);
@@ -1453,7 +1449,6 @@ static void udc_reinit(struct lpc32xx_ud
if (i != 0)
list_add_tail(&ep->ep.ep_list, &udc->gadget.ep_list);
- ep->desc = NULL;
ep->ep.maxpacket = ep->maxpacket;
INIT_LIST_HEAD(&ep->queue);
ep->req_pending = 0;
@@ -1515,7 +1510,7 @@ static void nuke(struct lpc32xx_ep *ep,
done(ep, req, status);
}
- if (ep->desc && status == -ESHUTDOWN) {
+ if (status == -ESHUTDOWN) {
uda_disable_hwepint(ep->udc, ep->hwep_num);
udc_disable_hwep(ep->udc, ep->hwep_num);
}
@@ -1658,9 +1653,6 @@ static int lpc32xx_ep_disable(struct usb
nuke(ep, -ESHUTDOWN);
- /* restore the endpoint's pristine config */
- ep->desc = NULL;
-
/* Clear all DMA statuses for this EP */
udc_ep_dma_disable(udc, ep->hwep_num);
writel(1 << ep->hwep_num, USBD_EOTINTCLR(udc->udp_baseaddr));
@@ -1696,7 +1688,7 @@ static int lpc32xx_ep_enable(struct usb_
unsigned long flags;
/* Verify EP data */
- if ((!_ep) || (!ep) || (!desc) || (ep->desc) ||
+ if ((!_ep) || (!ep) || (!desc) ||
(desc->bDescriptorType != USB_DT_ENDPOINT)) {
dev_dbg(udc->dev, "bad ep or descriptor\n");
return -EINVAL;
@@ -1754,7 +1746,6 @@ static int lpc32xx_ep_enable(struct usb_
/* Initialize endpoint to match the selected descriptor */
ep->is_in = (desc->bEndpointAddress & USB_DIR_IN) != 0;
- ep->desc = desc;
ep->ep.maxpacket = maxpacket;
/* Map hardware endpoint from base and direction */
@@ -1837,7 +1828,7 @@ static int lpc32xx_ep_queue(struct usb_e
udc = ep->udc;
- if (!_ep || (!ep->desc && ep->hwep_num_base != 0)) {
+ if (!_ep) {
dev_dbg(udc->dev, "invalid ep\n");
return -EINVAL;
}
@@ -1976,7 +1967,7 @@ static int lpc32xx_ep_set_halt(struct us
struct lpc32xx_udc *udc = ep->udc;
unsigned long flags;
- if ((!ep) || (ep->desc == NULL) || (ep->hwep_num <= 1))
+ if ((!ep) || (ep->hwep_num <= 1))
return -EINVAL;
/* Don't halt an IN EP */
@@ -2262,7 +2253,7 @@ static int udc_get_status(struct lpc32xx
case USB_RECIP_ENDPOINT:
tmp = wIndex & USB_ENDPOINT_NUMBER_MASK;
ep = &udc->ep[tmp];
- if ((tmp == 0) || (tmp >= NUM_ENDPOINTS) || (tmp && !ep->desc))
+ if ((tmp == 0) || (tmp >= NUM_ENDPOINTS))
return -EOPNOTSUPP;
if (wIndex & USB_DIR_IN) {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists