summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/udc/bcm63xx_udc.c
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2015-12-18 19:34:34 +0300
committerFelipe Balbi <balbi@ti.com>2015-12-22 21:08:40 +0300
commitea4a8cb1c2b47570e77f4489659e2c653ca66f9e (patch)
treee68ee1f989619e9a2e9ae2d1665c9191aa724743 /drivers/usb/gadget/udc/bcm63xx_udc.c
parent39cee200c23eb3e28056011a1dec053beba4a18a (diff)
downloadlinux-ea4a8cb1c2b47570e77f4489659e2c653ca66f9e.tar.xz
usb: gadget: bcm63xx_udc: use list_for_each_entry_safe
Use list_for_each_entry_safe() instead of list_for_each_safe() to simplify the code. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/udc/bcm63xx_udc.c')
-rw-r--r--drivers/usb/gadget/udc/bcm63xx_udc.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/usb/gadget/udc/bcm63xx_udc.c b/drivers/usb/gadget/udc/bcm63xx_udc.c
index 8cbb00325824..f5fccb3e4152 100644
--- a/drivers/usb/gadget/udc/bcm63xx_udc.c
+++ b/drivers/usb/gadget/udc/bcm63xx_udc.c
@@ -1083,7 +1083,7 @@ static int bcm63xx_ep_disable(struct usb_ep *ep)
struct bcm63xx_ep *bep = our_ep(ep);
struct bcm63xx_udc *udc = bep->udc;
struct iudma_ch *iudma = bep->iudma;
- struct list_head *pos, *n;
+ struct bcm63xx_req *breq, *n;
unsigned long flags;
if (!ep || !ep->desc)
@@ -1099,10 +1099,7 @@ static int bcm63xx_ep_disable(struct usb_ep *ep)
iudma_reset_channel(udc, iudma);
if (!list_empty(&bep->queue)) {
- list_for_each_safe(pos, n, &bep->queue) {
- struct bcm63xx_req *breq =
- list_entry(pos, struct bcm63xx_req, queue);
-
+ list_for_each_entry_safe(breq, n, &bep->queue, queue) {
usb_gadget_unmap_request(&udc->gadget, &breq->req,
iudma->is_tx);
list_del(&breq->queue);