Commit ea4a8cb1 authored by Geliang Tang's avatar Geliang Tang Committed by Felipe Balbi

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: default avatarGeliang Tang <geliangtang@163.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 39cee200
...@@ -1083,7 +1083,7 @@ static int bcm63xx_ep_disable(struct usb_ep *ep) ...@@ -1083,7 +1083,7 @@ static int bcm63xx_ep_disable(struct usb_ep *ep)
struct bcm63xx_ep *bep = our_ep(ep); struct bcm63xx_ep *bep = our_ep(ep);
struct bcm63xx_udc *udc = bep->udc; struct bcm63xx_udc *udc = bep->udc;
struct iudma_ch *iudma = bep->iudma; struct iudma_ch *iudma = bep->iudma;
struct list_head *pos, *n; struct bcm63xx_req *breq, *n;
unsigned long flags; unsigned long flags;
if (!ep || !ep->desc) if (!ep || !ep->desc)
...@@ -1099,10 +1099,7 @@ static int bcm63xx_ep_disable(struct usb_ep *ep) ...@@ -1099,10 +1099,7 @@ static int bcm63xx_ep_disable(struct usb_ep *ep)
iudma_reset_channel(udc, iudma); iudma_reset_channel(udc, iudma);
if (!list_empty(&bep->queue)) { if (!list_empty(&bep->queue)) {
list_for_each_safe(pos, n, &bep->queue) { list_for_each_entry_safe(breq, n, &bep->queue, queue) {
struct bcm63xx_req *breq =
list_entry(pos, struct bcm63xx_req, queue);
usb_gadget_unmap_request(&udc->gadget, &breq->req, usb_gadget_unmap_request(&udc->gadget, &breq->req,
iudma->is_tx); iudma->is_tx);
list_del(&breq->queue); list_del(&breq->queue);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment