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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9d8bab58b7
commit
c67ab134ba
@@ -1196,36 +1196,6 @@ s3c2410_udc_free_request(struct usb_ep *_ep, struct usb_request *_req)
|
||||
kfree(req);
|
||||
}
|
||||
|
||||
/*
|
||||
* s3c2410_udc_alloc_buffer
|
||||
*/
|
||||
static void *s3c2410_udc_alloc_buffer(struct usb_ep *_ep,
|
||||
unsigned bytes, dma_addr_t *dma, gfp_t mem_flags)
|
||||
{
|
||||
char *retval;
|
||||
|
||||
dprintk(DEBUG_VERBOSE, "%s()\n", __func__);
|
||||
|
||||
if (!the_controller->driver)
|
||||
return NULL;
|
||||
|
||||
retval = kmalloc (bytes, mem_flags);
|
||||
*dma = (dma_addr_t) retval;
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* s3c2410_udc_free_buffer
|
||||
*/
|
||||
static void s3c2410_udc_free_buffer (struct usb_ep *_ep, void *buf,
|
||||
dma_addr_t dma, unsigned bytes)
|
||||
{
|
||||
dprintk(DEBUG_VERBOSE, "%s()\n", __func__);
|
||||
|
||||
if (bytes)
|
||||
kfree (buf);
|
||||
}
|
||||
|
||||
/*
|
||||
* s3c2410_udc_queue
|
||||
*/
|
||||
@@ -1441,9 +1411,6 @@ static const struct usb_ep_ops s3c2410_ep_ops = {
|
||||
.alloc_request = s3c2410_udc_alloc_request,
|
||||
.free_request = s3c2410_udc_free_request,
|
||||
|
||||
.alloc_buffer = s3c2410_udc_alloc_buffer,
|
||||
.free_buffer = s3c2410_udc_free_buffer,
|
||||
|
||||
.queue = s3c2410_udc_queue,
|
||||
.dequeue = s3c2410_udc_dequeue,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user