diff options
Diffstat (limited to 'drivers/usb/gadget/goku_udc.c')
-rw-r--r-- | drivers/usb/gadget/goku_udc.c | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c index ae931af05cef..dfadb643597b 100644 --- a/drivers/usb/gadget/goku_udc.c +++ b/drivers/usb/gadget/goku_udc.c | |||
@@ -296,51 +296,6 @@ goku_free_request(struct usb_ep *_ep, struct usb_request *_req) | |||
296 | 296 | ||
297 | /*-------------------------------------------------------------------------*/ | 297 | /*-------------------------------------------------------------------------*/ |
298 | 298 | ||
299 | /* allocating buffers this way eliminates dma mapping overhead, which | ||
300 | * on some platforms will mean eliminating a per-io buffer copy. with | ||
301 | * some kinds of system caches, further tweaks may still be needed. | ||
302 | */ | ||
303 | static void * | ||
304 | goku_alloc_buffer(struct usb_ep *_ep, unsigned bytes, | ||
305 | dma_addr_t *dma, gfp_t gfp_flags) | ||
306 | { | ||
307 | void *retval; | ||
308 | struct goku_ep *ep; | ||
309 | |||
310 | ep = container_of(_ep, struct goku_ep, ep); | ||
311 | if (!_ep) | ||
312 | return NULL; | ||
313 | *dma = DMA_ADDR_INVALID; | ||
314 | |||
315 | if (ep->dma) { | ||
316 | /* the main problem with this call is that it wastes memory | ||
317 | * on typical 1/N page allocations: it allocates 1-N pages. | ||
318 | */ | ||
319 | #warning Using dma_alloc_coherent even with buffers smaller than a page. | ||
320 | retval = dma_alloc_coherent(&ep->dev->pdev->dev, | ||
321 | bytes, dma, gfp_flags); | ||
322 | } else | ||
323 | retval = kmalloc(bytes, gfp_flags); | ||
324 | return retval; | ||
325 | } | ||
326 | |||
327 | static void | ||
328 | goku_free_buffer(struct usb_ep *_ep, void *buf, dma_addr_t dma, unsigned bytes) | ||
329 | { | ||
330 | /* free memory into the right allocator */ | ||
331 | if (dma != DMA_ADDR_INVALID) { | ||
332 | struct goku_ep *ep; | ||
333 | |||
334 | ep = container_of(_ep, struct goku_ep, ep); | ||
335 | if (!_ep) | ||
336 | return; | ||
337 | dma_free_coherent(&ep->dev->pdev->dev, bytes, buf, dma); | ||
338 | } else | ||
339 | kfree (buf); | ||
340 | } | ||
341 | |||
342 | /*-------------------------------------------------------------------------*/ | ||
343 | |||
344 | static void | 299 | static void |
345 | done(struct goku_ep *ep, struct goku_request *req, int status) | 300 | done(struct goku_ep *ep, struct goku_request *req, int status) |
346 | { | 301 | { |
@@ -1026,9 +981,6 @@ static struct usb_ep_ops goku_ep_ops = { | |||
1026 | .alloc_request = goku_alloc_request, | 981 | .alloc_request = goku_alloc_request, |
1027 | .free_request = goku_free_request, | 982 | .free_request = goku_free_request, |
1028 | 983 | ||
1029 | .alloc_buffer = goku_alloc_buffer, | ||
1030 | .free_buffer = goku_free_buffer, | ||
1031 | |||
1032 | .queue = goku_queue, | 984 | .queue = goku_queue, |
1033 | .dequeue = goku_dequeue, | 985 | .dequeue = goku_dequeue, |
1034 | 986 | ||