diff options
author | Michal Sojka <sojka@merica.cz> | 2014-09-24 16:43:19 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-25 10:58:50 -0400 |
commit | 304f7e5e1d08fa2f5674c1323bd0ebd806c86b81 (patch) | |
tree | 0d69327f14a23a66061fc9d39dee1ec7c6b56932 /drivers/usb/gadget/udc | |
parent | 3fc2aa5522ab958374d93ef5d2e12df7ee233c91 (diff) |
usb: gadget: Refactor request completion
Use the recently introduced usb_gadget_giveback_request() in favor of
direct invocation of the completion routine.
All places in drivers/usb/ matching "[-.]complete(" were replaced with a
call to usb_gadget_giveback_request(). This was compile-tested with all
ARM drivers enabled and runtime-tested for musb.
Signed-off-by: Michal Sojka <sojka@merica.cz>
Acked-by: Felipe Balbi <balbi@ti.com>
Tested-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget/udc')
24 files changed, 32 insertions, 47 deletions
diff --git a/drivers/usb/gadget/udc/amd5536udc.c b/drivers/usb/gadget/udc/amd5536udc.c index 41b062eb4de0..3b9d13848a4f 100644 --- a/drivers/usb/gadget/udc/amd5536udc.c +++ b/drivers/usb/gadget/udc/amd5536udc.c | |||
@@ -841,7 +841,7 @@ __acquires(ep->dev->lock) | |||
841 | &req->req, req->req.length, ep->ep.name, sts); | 841 | &req->req, req->req.length, ep->ep.name, sts); |
842 | 842 | ||
843 | spin_unlock(&dev->lock); | 843 | spin_unlock(&dev->lock); |
844 | req->req.complete(&ep->ep, &req->req); | 844 | usb_gadget_giveback_request(&ep->ep, &req->req); |
845 | spin_lock(&dev->lock); | 845 | spin_lock(&dev->lock); |
846 | ep->halted = halted; | 846 | ep->halted = halted; |
847 | } | 847 | } |
diff --git a/drivers/usb/gadget/udc/at91_udc.c b/drivers/usb/gadget/udc/at91_udc.c index cfd18bcca723..9968f5331fe4 100644 --- a/drivers/usb/gadget/udc/at91_udc.c +++ b/drivers/usb/gadget/udc/at91_udc.c | |||
@@ -267,7 +267,7 @@ static void done(struct at91_ep *ep, struct at91_request *req, int status) | |||
267 | 267 | ||
268 | ep->stopped = 1; | 268 | ep->stopped = 1; |
269 | spin_unlock(&udc->lock); | 269 | spin_unlock(&udc->lock); |
270 | req->req.complete(&ep->ep, &req->req); | 270 | usb_gadget_giveback_request(&ep->ep, &req->req); |
271 | spin_lock(&udc->lock); | 271 | spin_lock(&udc->lock); |
272 | ep->stopped = stopped; | 272 | ep->stopped = stopped; |
273 | 273 | ||
diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index c9fe67e29d35..1529926e20a0 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c | |||
@@ -463,7 +463,7 @@ static void receive_data(struct usba_ep *ep) | |||
463 | list_del_init(&req->queue); | 463 | list_del_init(&req->queue); |
464 | usba_ep_writel(ep, CTL_DIS, USBA_RX_BK_RDY); | 464 | usba_ep_writel(ep, CTL_DIS, USBA_RX_BK_RDY); |
465 | spin_unlock(&udc->lock); | 465 | spin_unlock(&udc->lock); |
466 | req->req.complete(&ep->ep, &req->req); | 466 | usb_gadget_giveback_request(&ep->ep, &req->req); |
467 | spin_lock(&udc->lock); | 467 | spin_lock(&udc->lock); |
468 | } | 468 | } |
469 | 469 | ||
@@ -495,7 +495,7 @@ request_complete(struct usba_ep *ep, struct usba_request *req, int status) | |||
495 | ep->ep.name, req, req->req.status, req->req.actual); | 495 | ep->ep.name, req, req->req.status, req->req.actual); |
496 | 496 | ||
497 | spin_unlock(&udc->lock); | 497 | spin_unlock(&udc->lock); |
498 | req->req.complete(&ep->ep, &req->req); | 498 | usb_gadget_giveback_request(&ep->ep, &req->req); |
499 | spin_lock(&udc->lock); | 499 | spin_lock(&udc->lock); |
500 | } | 500 | } |
501 | 501 | ||
diff --git a/drivers/usb/gadget/udc/bcm63xx_udc.c b/drivers/usb/gadget/udc/bcm63xx_udc.c index e969eb809a85..2235b8808700 100644 --- a/drivers/usb/gadget/udc/bcm63xx_udc.c +++ b/drivers/usb/gadget/udc/bcm63xx_udc.c | |||
@@ -1088,7 +1088,7 @@ static int bcm63xx_ep_disable(struct usb_ep *ep) | |||
1088 | breq->req.status = -ESHUTDOWN; | 1088 | breq->req.status = -ESHUTDOWN; |
1089 | 1089 | ||
1090 | spin_unlock_irqrestore(&udc->lock, flags); | 1090 | spin_unlock_irqrestore(&udc->lock, flags); |
1091 | breq->req.complete(&iudma->bep->ep, &breq->req); | 1091 | usb_gadget_giveback_request(&iudma->bep->ep, &breq->req); |
1092 | spin_lock_irqsave(&udc->lock, flags); | 1092 | spin_lock_irqsave(&udc->lock, flags); |
1093 | } | 1093 | } |
1094 | } | 1094 | } |
diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c index 2b54955d3166..81dc5959e36b 100644 --- a/drivers/usb/gadget/udc/dummy_hcd.c +++ b/drivers/usb/gadget/udc/dummy_hcd.c | |||
@@ -258,7 +258,7 @@ static void nuke(struct dummy *dum, struct dummy_ep *ep) | |||
258 | req->req.status = -ESHUTDOWN; | 258 | req->req.status = -ESHUTDOWN; |
259 | 259 | ||
260 | spin_unlock(&dum->lock); | 260 | spin_unlock(&dum->lock); |
261 | req->req.complete(&ep->ep, &req->req); | 261 | usb_gadget_giveback_request(&ep->ep, &req->req); |
262 | spin_lock(&dum->lock); | 262 | spin_lock(&dum->lock); |
263 | } | 263 | } |
264 | } | 264 | } |
@@ -658,7 +658,7 @@ static int dummy_queue(struct usb_ep *_ep, struct usb_request *_req, | |||
658 | spin_unlock(&dum->lock); | 658 | spin_unlock(&dum->lock); |
659 | _req->actual = _req->length; | 659 | _req->actual = _req->length; |
660 | _req->status = 0; | 660 | _req->status = 0; |
661 | _req->complete(_ep, _req); | 661 | usb_gadget_giveback_request(_ep, _req); |
662 | spin_lock(&dum->lock); | 662 | spin_lock(&dum->lock); |
663 | } else | 663 | } else |
664 | list_add_tail(&req->queue, &ep->queue); | 664 | list_add_tail(&req->queue, &ep->queue); |
@@ -702,7 +702,7 @@ static int dummy_dequeue(struct usb_ep *_ep, struct usb_request *_req) | |||
702 | dev_dbg(udc_dev(dum), | 702 | dev_dbg(udc_dev(dum), |
703 | "dequeued req %p from %s, len %d buf %p\n", | 703 | "dequeued req %p from %s, len %d buf %p\n", |
704 | req, _ep->name, _req->length, _req->buf); | 704 | req, _ep->name, _req->length, _req->buf); |
705 | _req->complete(_ep, _req); | 705 | usb_gadget_giveback_request(_ep, _req); |
706 | } | 706 | } |
707 | local_irq_restore(flags); | 707 | local_irq_restore(flags); |
708 | return retval; | 708 | return retval; |
@@ -1385,7 +1385,7 @@ top: | |||
1385 | list_del_init(&req->queue); | 1385 | list_del_init(&req->queue); |
1386 | 1386 | ||
1387 | spin_unlock(&dum->lock); | 1387 | spin_unlock(&dum->lock); |
1388 | req->req.complete(&ep->ep, &req->req); | 1388 | usb_gadget_giveback_request(&ep->ep, &req->req); |
1389 | spin_lock(&dum->lock); | 1389 | spin_lock(&dum->lock); |
1390 | 1390 | ||
1391 | /* requests might have been unlinked... */ | 1391 | /* requests might have been unlinked... */ |
@@ -1761,7 +1761,7 @@ restart: | |||
1761 | req); | 1761 | req); |
1762 | 1762 | ||
1763 | spin_unlock(&dum->lock); | 1763 | spin_unlock(&dum->lock); |
1764 | req->req.complete(&ep->ep, &req->req); | 1764 | usb_gadget_giveback_request(&ep->ep, &req->req); |
1765 | spin_lock(&dum->lock); | 1765 | spin_lock(&dum->lock); |
1766 | ep->already_seen = 0; | 1766 | ep->already_seen = 0; |
1767 | goto restart; | 1767 | goto restart; |
diff --git a/drivers/usb/gadget/udc/fotg210-udc.c b/drivers/usb/gadget/udc/fotg210-udc.c index e143d69f6017..1d315921bf34 100644 --- a/drivers/usb/gadget/udc/fotg210-udc.c +++ b/drivers/usb/gadget/udc/fotg210-udc.c | |||
@@ -70,7 +70,7 @@ static void fotg210_done(struct fotg210_ep *ep, struct fotg210_request *req, | |||
70 | req->req.status = status; | 70 | req->req.status = status; |
71 | 71 | ||
72 | spin_unlock(&ep->fotg210->lock); | 72 | spin_unlock(&ep->fotg210->lock); |
73 | req->req.complete(&ep->ep, &req->req); | 73 | usb_gadget_giveback_request(&ep->ep, &req->req); |
74 | spin_lock(&ep->fotg210->lock); | 74 | spin_lock(&ep->fotg210->lock); |
75 | 75 | ||
76 | if (ep->epnum) { | 76 | if (ep->epnum) { |
diff --git a/drivers/usb/gadget/udc/fsl_qe_udc.c b/drivers/usb/gadget/udc/fsl_qe_udc.c index 732430804841..dd18ea38e391 100644 --- a/drivers/usb/gadget/udc/fsl_qe_udc.c +++ b/drivers/usb/gadget/udc/fsl_qe_udc.c | |||
@@ -118,10 +118,7 @@ static void done(struct qe_ep *ep, struct qe_req *req, int status) | |||
118 | ep->stopped = 1; | 118 | ep->stopped = 1; |
119 | spin_unlock(&udc->lock); | 119 | spin_unlock(&udc->lock); |
120 | 120 | ||
121 | /* this complete() should a func implemented by gadget layer, | 121 | usb_gadget_giveback_request(&ep->ep, &req->req); |
122 | * eg fsg->bulk_in_complete() */ | ||
123 | if (req->req.complete) | ||
124 | req->req.complete(&ep->ep, &req->req); | ||
125 | 122 | ||
126 | spin_lock(&udc->lock); | 123 | spin_lock(&udc->lock); |
127 | 124 | ||
@@ -2728,4 +2725,3 @@ module_platform_driver(udc_driver); | |||
2728 | MODULE_DESCRIPTION(DRIVER_DESC); | 2725 | MODULE_DESCRIPTION(DRIVER_DESC); |
2729 | MODULE_AUTHOR(DRIVER_AUTHOR); | 2726 | MODULE_AUTHOR(DRIVER_AUTHOR); |
2730 | MODULE_LICENSE("GPL"); | 2727 | MODULE_LICENSE("GPL"); |
2731 | |||
diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/drivers/usb/gadget/udc/fsl_udc_core.c index 75b23ea077a7..c3620791a315 100644 --- a/drivers/usb/gadget/udc/fsl_udc_core.c +++ b/drivers/usb/gadget/udc/fsl_udc_core.c | |||
@@ -197,10 +197,8 @@ __acquires(ep->udc->lock) | |||
197 | ep->stopped = 1; | 197 | ep->stopped = 1; |
198 | 198 | ||
199 | spin_unlock(&ep->udc->lock); | 199 | spin_unlock(&ep->udc->lock); |
200 | /* complete() is from gadget layer, | 200 | |
201 | * eg fsg->bulk_in_complete() */ | 201 | usb_gadget_giveback_request(&ep->ep, &req->req); |
202 | if (req->req.complete) | ||
203 | req->req.complete(&ep->ep, &req->req); | ||
204 | 202 | ||
205 | spin_lock(&ep->udc->lock); | 203 | spin_lock(&ep->udc->lock); |
206 | ep->stopped = stopped; | 204 | ep->stopped = stopped; |
diff --git a/drivers/usb/gadget/udc/fusb300_udc.c b/drivers/usb/gadget/udc/fusb300_udc.c index 5c5d1adda7eb..8286df72add4 100644 --- a/drivers/usb/gadget/udc/fusb300_udc.c +++ b/drivers/usb/gadget/udc/fusb300_udc.c | |||
@@ -876,7 +876,7 @@ static void done(struct fusb300_ep *ep, struct fusb300_request *req, | |||
876 | req->req.status = status; | 876 | req->req.status = status; |
877 | 877 | ||
878 | spin_unlock(&ep->fusb300->lock); | 878 | spin_unlock(&ep->fusb300->lock); |
879 | req->req.complete(&ep->ep, &req->req); | 879 | usb_gadget_giveback_request(&ep->ep, &req->req); |
880 | spin_lock(&ep->fusb300->lock); | 880 | spin_lock(&ep->fusb300->lock); |
881 | 881 | ||
882 | if (ep->epnum) { | 882 | if (ep->epnum) { |
diff --git a/drivers/usb/gadget/udc/goku_udc.c b/drivers/usb/gadget/udc/goku_udc.c index 6c85839e15ad..bf9c5ef8b56b 100644 --- a/drivers/usb/gadget/udc/goku_udc.c +++ b/drivers/usb/gadget/udc/goku_udc.c | |||
@@ -320,7 +320,7 @@ done(struct goku_ep *ep, struct goku_request *req, int status) | |||
320 | /* don't modify queue heads during completion callback */ | 320 | /* don't modify queue heads during completion callback */ |
321 | ep->stopped = 1; | 321 | ep->stopped = 1; |
322 | spin_unlock(&dev->lock); | 322 | spin_unlock(&dev->lock); |
323 | req->req.complete(&ep->ep, &req->req); | 323 | usb_gadget_giveback_request(&ep->ep, &req->req); |
324 | spin_lock(&dev->lock); | 324 | spin_lock(&dev->lock); |
325 | ep->stopped = stopped; | 325 | ep->stopped = stopped; |
326 | } | 326 | } |
diff --git a/drivers/usb/gadget/udc/gr_udc.c b/drivers/usb/gadget/udc/gr_udc.c index ecd10b574bfd..1b3048a6a2a3 100644 --- a/drivers/usb/gadget/udc/gr_udc.c +++ b/drivers/usb/gadget/udc/gr_udc.c | |||
@@ -357,7 +357,7 @@ static void gr_finish_request(struct gr_ep *ep, struct gr_request *req, | |||
357 | } else if (req->req.complete) { | 357 | } else if (req->req.complete) { |
358 | spin_unlock(&dev->lock); | 358 | spin_unlock(&dev->lock); |
359 | 359 | ||
360 | req->req.complete(&ep->ep, &req->req); | 360 | usb_gadget_giveback_request(&ep->ep, &req->req); |
361 | 361 | ||
362 | spin_lock(&dev->lock); | 362 | spin_lock(&dev->lock); |
363 | } | 363 | } |
diff --git a/drivers/usb/gadget/udc/lpc32xx_udc.c b/drivers/usb/gadget/udc/lpc32xx_udc.c index 1629ad7dcb80..feab0bac8fdc 100644 --- a/drivers/usb/gadget/udc/lpc32xx_udc.c +++ b/drivers/usb/gadget/udc/lpc32xx_udc.c | |||
@@ -1479,7 +1479,7 @@ static void done(struct lpc32xx_ep *ep, struct lpc32xx_request *req, int status) | |||
1479 | 1479 | ||
1480 | ep->req_pending = 0; | 1480 | ep->req_pending = 0; |
1481 | spin_unlock(&udc->lock); | 1481 | spin_unlock(&udc->lock); |
1482 | req->req.complete(&ep->ep, &req->req); | 1482 | usb_gadget_giveback_request(&ep->ep, &req->req); |
1483 | spin_lock(&udc->lock); | 1483 | spin_lock(&udc->lock); |
1484 | } | 1484 | } |
1485 | 1485 | ||
diff --git a/drivers/usb/gadget/udc/m66592-udc.c b/drivers/usb/gadget/udc/m66592-udc.c index de88d33b44b2..898565687a8c 100644 --- a/drivers/usb/gadget/udc/m66592-udc.c +++ b/drivers/usb/gadget/udc/m66592-udc.c | |||
@@ -729,7 +729,7 @@ __acquires(m66592->lock) | |||
729 | restart = 1; | 729 | restart = 1; |
730 | 730 | ||
731 | spin_unlock(&ep->m66592->lock); | 731 | spin_unlock(&ep->m66592->lock); |
732 | req->req.complete(&ep->ep, &req->req); | 732 | usb_gadget_giveback_request(&ep->ep, &req->req); |
733 | spin_lock(&ep->m66592->lock); | 733 | spin_lock(&ep->m66592->lock); |
734 | 734 | ||
735 | if (restart) { | 735 | if (restart) { |
diff --git a/drivers/usb/gadget/udc/mv_u3d_core.c b/drivers/usb/gadget/udc/mv_u3d_core.c index 16248711c152..046a1f808b0d 100644 --- a/drivers/usb/gadget/udc/mv_u3d_core.c +++ b/drivers/usb/gadget/udc/mv_u3d_core.c | |||
@@ -222,12 +222,8 @@ void mv_u3d_done(struct mv_u3d_ep *ep, struct mv_u3d_req *req, int status) | |||
222 | } | 222 | } |
223 | 223 | ||
224 | spin_unlock(&ep->u3d->lock); | 224 | spin_unlock(&ep->u3d->lock); |
225 | /* | 225 | |
226 | * complete() is from gadget layer, | 226 | usb_gadget_giveback_request(&ep->ep, &req->req); |
227 | * eg fsg->bulk_in_complete() | ||
228 | */ | ||
229 | if (req->req.complete) | ||
230 | req->req.complete(&ep->ep, &req->req); | ||
231 | 227 | ||
232 | spin_lock(&ep->u3d->lock); | 228 | spin_lock(&ep->u3d->lock); |
233 | } | 229 | } |
diff --git a/drivers/usb/gadget/udc/mv_udc_core.c b/drivers/usb/gadget/udc/mv_udc_core.c index 040fb169b162..3c5db80ae325 100644 --- a/drivers/usb/gadget/udc/mv_udc_core.c +++ b/drivers/usb/gadget/udc/mv_udc_core.c | |||
@@ -248,12 +248,8 @@ static void done(struct mv_ep *ep, struct mv_req *req, int status) | |||
248 | ep->stopped = 1; | 248 | ep->stopped = 1; |
249 | 249 | ||
250 | spin_unlock(&ep->udc->lock); | 250 | spin_unlock(&ep->udc->lock); |
251 | /* | 251 | |
252 | * complete() is from gadget layer, | 252 | usb_gadget_giveback_request(&ep->ep, &req->req); |
253 | * eg fsg->bulk_in_complete() | ||
254 | */ | ||
255 | if (req->req.complete) | ||
256 | req->req.complete(&ep->ep, &req->req); | ||
257 | 253 | ||
258 | spin_lock(&ep->udc->lock); | 254 | spin_lock(&ep->udc->lock); |
259 | ep->stopped = stopped; | 255 | ep->stopped = stopped; |
diff --git a/drivers/usb/gadget/udc/net2272.c b/drivers/usb/gadget/udc/net2272.c index 059cfe527982..84d7162a8022 100644 --- a/drivers/usb/gadget/udc/net2272.c +++ b/drivers/usb/gadget/udc/net2272.c | |||
@@ -394,7 +394,7 @@ net2272_done(struct net2272_ep *ep, struct net2272_request *req, int status) | |||
394 | /* don't modify queue heads during completion callback */ | 394 | /* don't modify queue heads during completion callback */ |
395 | ep->stopped = 1; | 395 | ep->stopped = 1; |
396 | spin_unlock(&dev->lock); | 396 | spin_unlock(&dev->lock); |
397 | req->req.complete(&ep->ep, &req->req); | 397 | usb_gadget_giveback_request(&ep->ep, &req->req); |
398 | spin_lock(&dev->lock); | 398 | spin_lock(&dev->lock); |
399 | ep->stopped = stopped; | 399 | ep->stopped = stopped; |
400 | } | 400 | } |
diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c index 2e95715b50c0..8d13337e2dde 100644 --- a/drivers/usb/gadget/udc/net2280.c +++ b/drivers/usb/gadget/udc/net2280.c | |||
@@ -928,7 +928,7 @@ done(struct net2280_ep *ep, struct net2280_request *req, int status) | |||
928 | /* don't modify queue heads during completion callback */ | 928 | /* don't modify queue heads during completion callback */ |
929 | ep->stopped = 1; | 929 | ep->stopped = 1; |
930 | spin_unlock(&dev->lock); | 930 | spin_unlock(&dev->lock); |
931 | req->req.complete(&ep->ep, &req->req); | 931 | usb_gadget_giveback_request(&ep->ep, &req->req); |
932 | spin_lock(&dev->lock); | 932 | spin_lock(&dev->lock); |
933 | ep->stopped = stopped; | 933 | ep->stopped = stopped; |
934 | } | 934 | } |
diff --git a/drivers/usb/gadget/udc/omap_udc.c b/drivers/usb/gadget/udc/omap_udc.c index e731373fd4d7..dcdfea46003b 100644 --- a/drivers/usb/gadget/udc/omap_udc.c +++ b/drivers/usb/gadget/udc/omap_udc.c | |||
@@ -315,7 +315,7 @@ done(struct omap_ep *ep, struct omap_req *req, int status) | |||
315 | /* don't modify queue heads during completion callback */ | 315 | /* don't modify queue heads during completion callback */ |
316 | ep->stopped = 1; | 316 | ep->stopped = 1; |
317 | spin_unlock(&ep->udc->lock); | 317 | spin_unlock(&ep->udc->lock); |
318 | req->req.complete(&ep->ep, &req->req); | 318 | usb_gadget_giveback_request(&ep->ep, &req->req); |
319 | spin_lock(&ep->udc->lock); | 319 | spin_lock(&ep->udc->lock); |
320 | ep->stopped = stopped; | 320 | ep->stopped = stopped; |
321 | } | 321 | } |
diff --git a/drivers/usb/gadget/udc/pch_udc.c b/drivers/usb/gadget/udc/pch_udc.c index 460d953c91b6..ccbe3d4a2a50 100644 --- a/drivers/usb/gadget/udc/pch_udc.c +++ b/drivers/usb/gadget/udc/pch_udc.c | |||
@@ -1490,7 +1490,7 @@ static void complete_req(struct pch_udc_ep *ep, struct pch_udc_request *req, | |||
1490 | spin_unlock(&dev->lock); | 1490 | spin_unlock(&dev->lock); |
1491 | if (!ep->in) | 1491 | if (!ep->in) |
1492 | pch_udc_ep_clear_rrdy(ep); | 1492 | pch_udc_ep_clear_rrdy(ep); |
1493 | req->req.complete(&ep->ep, &req->req); | 1493 | usb_gadget_giveback_request(&ep->ep, &req->req); |
1494 | spin_lock(&dev->lock); | 1494 | spin_lock(&dev->lock); |
1495 | ep->halted = halted; | 1495 | ep->halted = halted; |
1496 | } | 1496 | } |
diff --git a/drivers/usb/gadget/udc/pxa25x_udc.c b/drivers/usb/gadget/udc/pxa25x_udc.c index 251e4d5ee152..42f7eeb8ff6f 100644 --- a/drivers/usb/gadget/udc/pxa25x_udc.c +++ b/drivers/usb/gadget/udc/pxa25x_udc.c | |||
@@ -347,7 +347,7 @@ static void done(struct pxa25x_ep *ep, struct pxa25x_request *req, int status) | |||
347 | 347 | ||
348 | /* don't modify queue heads during completion callback */ | 348 | /* don't modify queue heads during completion callback */ |
349 | ep->stopped = 1; | 349 | ep->stopped = 1; |
350 | req->req.complete(&ep->ep, &req->req); | 350 | usb_gadget_giveback_request(&ep->ep, &req->req); |
351 | ep->stopped = stopped; | 351 | ep->stopped = stopped; |
352 | } | 352 | } |
353 | 353 | ||
diff --git a/drivers/usb/gadget/udc/pxa27x_udc.c b/drivers/usb/gadget/udc/pxa27x_udc.c index 597d39f89420..4868369eeec6 100644 --- a/drivers/usb/gadget/udc/pxa27x_udc.c +++ b/drivers/usb/gadget/udc/pxa27x_udc.c | |||
@@ -758,7 +758,7 @@ static void req_done(struct pxa_ep *ep, struct pxa27x_request *req, int status, | |||
758 | if (pflags) | 758 | if (pflags) |
759 | spin_unlock_irqrestore(&ep->lock, *pflags); | 759 | spin_unlock_irqrestore(&ep->lock, *pflags); |
760 | local_irq_save(flags); | 760 | local_irq_save(flags); |
761 | req->req.complete(&req->udc_usb_ep->usb_ep, &req->req); | 761 | usb_gadget_giveback_request(&req->udc_usb_ep->usb_ep, &req->req); |
762 | local_irq_restore(flags); | 762 | local_irq_restore(flags); |
763 | if (pflags) | 763 | if (pflags) |
764 | spin_lock_irqsave(&ep->lock, *pflags); | 764 | spin_lock_irqsave(&ep->lock, *pflags); |
diff --git a/drivers/usb/gadget/udc/r8a66597-udc.c b/drivers/usb/gadget/udc/r8a66597-udc.c index de9c400b9944..f8186613b53e 100644 --- a/drivers/usb/gadget/udc/r8a66597-udc.c +++ b/drivers/usb/gadget/udc/r8a66597-udc.c | |||
@@ -925,7 +925,7 @@ __acquires(r8a66597->lock) | |||
925 | sudmac_free_channel(ep->r8a66597, ep, req); | 925 | sudmac_free_channel(ep->r8a66597, ep, req); |
926 | 926 | ||
927 | spin_unlock(&ep->r8a66597->lock); | 927 | spin_unlock(&ep->r8a66597->lock); |
928 | req->req.complete(&ep->ep, &req->req); | 928 | usb_gadget_giveback_request(&ep->ep, &req->req); |
929 | spin_lock(&ep->r8a66597->lock); | 929 | spin_lock(&ep->r8a66597->lock); |
930 | 930 | ||
931 | if (restart) { | 931 | if (restart) { |
diff --git a/drivers/usb/gadget/udc/s3c-hsudc.c b/drivers/usb/gadget/udc/s3c-hsudc.c index 10c6a128250c..dfbf55797360 100644 --- a/drivers/usb/gadget/udc/s3c-hsudc.c +++ b/drivers/usb/gadget/udc/s3c-hsudc.c | |||
@@ -258,8 +258,7 @@ static void s3c_hsudc_complete_request(struct s3c_hsudc_ep *hsep, | |||
258 | 258 | ||
259 | hsep->stopped = 1; | 259 | hsep->stopped = 1; |
260 | spin_unlock(&hsudc->lock); | 260 | spin_unlock(&hsudc->lock); |
261 | if (hsreq->req.complete != NULL) | 261 | usb_gadget_giveback_request(&hsep->ep, &hsreq->req); |
262 | hsreq->req.complete(&hsep->ep, &hsreq->req); | ||
263 | spin_lock(&hsudc->lock); | 262 | spin_lock(&hsudc->lock); |
264 | hsep->stopped = stopped; | 263 | hsep->stopped = stopped; |
265 | } | 264 | } |
diff --git a/drivers/usb/gadget/udc/s3c2410_udc.c b/drivers/usb/gadget/udc/s3c2410_udc.c index 357b58e0087b..ff423d15beff 100644 --- a/drivers/usb/gadget/udc/s3c2410_udc.c +++ b/drivers/usb/gadget/udc/s3c2410_udc.c | |||
@@ -272,7 +272,7 @@ static void s3c2410_udc_done(struct s3c2410_ep *ep, | |||
272 | status = req->req.status; | 272 | status = req->req.status; |
273 | 273 | ||
274 | ep->halted = 1; | 274 | ep->halted = 1; |
275 | req->req.complete(&ep->ep, &req->req); | 275 | usb_gadget_giveback_request(&ep->ep, &req->req); |
276 | ep->halted = halted; | 276 | ep->halted = halted; |
277 | } | 277 | } |
278 | 278 | ||