aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/dummy_hcd.c
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2007-07-01 15:21:00 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-12 19:34:42 -0400
commitc67ab134ba9f83f9de86e58adfeaa14a9efa6e00 (patch)
treedf9022b4a38e955abbf254d71e00ac1fecce6420 /drivers/usb/gadget/dummy_hcd.c
parent9d8bab58b758cd5a96d368a8cc64111c9ab50407 (diff)
usb gadget stack: remove usb_ep_*_buffer(), part 2
This patch removes controller driver infrastructure which supported the now-removed usb_ep_{alloc,free}_buffer() calls. As can be seen, many of the implementations of this were broken to various degrees. Many didn't properly return dma-coherent mappings; those which did so were necessarily ugly because of bogosity in the underlying dma_free_coherent() calls ... which on many platforms can't be called from the same contexts (notably in_irq) from which their dma_alloc_coherent() sibling can be called. The main potential downside of removing this is that gadget drivers wouldn't have specific knowledge that the controller drivers have: endpoints that aren't dma-capable don't need any dma mappings at all. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/dummy_hcd.c')
-rw-r--r--drivers/usb/gadget/dummy_hcd.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index 9040b50d6425..f2fbdc7fe376 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -497,38 +497,6 @@ dummy_free_request (struct usb_ep *_ep, struct usb_request *_req)
497 kfree (req); 497 kfree (req);
498} 498}
499 499
500static void *
501dummy_alloc_buffer (
502 struct usb_ep *_ep,
503 unsigned bytes,
504 dma_addr_t *dma,
505 gfp_t mem_flags
506) {
507 char *retval;
508 struct dummy_ep *ep;
509 struct dummy *dum;
510
511 ep = usb_ep_to_dummy_ep (_ep);
512 dum = ep_to_dummy (ep);
513
514 if (!dum->driver)
515 return NULL;
516 retval = kmalloc (bytes, mem_flags);
517 *dma = (dma_addr_t) retval;
518 return retval;
519}
520
521static void
522dummy_free_buffer (
523 struct usb_ep *_ep,
524 void *buf,
525 dma_addr_t dma,
526 unsigned bytes
527) {
528 if (bytes)
529 kfree (buf);
530}
531
532static void 500static void
533fifo_complete (struct usb_ep *ep, struct usb_request *req) 501fifo_complete (struct usb_ep *ep, struct usb_request *req)
534{ 502{
@@ -659,10 +627,6 @@ static const struct usb_ep_ops dummy_ep_ops = {
659 .alloc_request = dummy_alloc_request, 627 .alloc_request = dummy_alloc_request,
660 .free_request = dummy_free_request, 628 .free_request = dummy_free_request,
661 629
662 .alloc_buffer = dummy_alloc_buffer,
663 .free_buffer = dummy_free_buffer,
664 /* map, unmap, ... eventually hook the "generic" dma calls */
665
666 .queue = dummy_queue, 630 .queue = dummy_queue,
667 .dequeue = dummy_dequeue, 631 .dequeue = dummy_dequeue,
668 632