From 9d8bab58b758cd5a96d368a8cc64111c9ab50407 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Sun, 1 Jul 2007 11:04:54 -0700 Subject: usb gadget stack: remove usb_ep_*_buffer(), part 1 Remove usb_ep_{alloc,free}_buffer() calls, for small dma-coherent buffers. This patch just removes the interface and its users; later patches will remove controller driver support. - This interface is invariably not implemented correctly in the controller drivers (e.g. using dma pools, a mechanism which post-dates the interface by several years). - At this point no gadget driver really *needs* to use it. In current kernels, any driver that needs such a mechanism could allocate a dma pool themselves. Removing this interface is thus a simplification and improvement. Note that the gmidi.c driver had a bug in this area; fixed. Signed-off-by: David Brownell Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/zero.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'drivers/usb/gadget/zero.c') diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c index 7078374d0b79..a2e6e3fc8c8d 100644 --- a/drivers/usb/gadget/zero.c +++ b/drivers/usb/gadget/zero.c @@ -481,8 +481,7 @@ alloc_ep_req (struct usb_ep *ep, unsigned length) req = usb_ep_alloc_request (ep, GFP_ATOMIC); if (req) { req->length = length; - req->buf = usb_ep_alloc_buffer (ep, length, - &req->dma, GFP_ATOMIC); + req->buf = kmalloc(length, GFP_ATOMIC); if (!req->buf) { usb_ep_free_request (ep, req); req = NULL; @@ -493,8 +492,7 @@ alloc_ep_req (struct usb_ep *ep, unsigned length) static void free_ep_req (struct usb_ep *ep, struct usb_request *req) { - if (req->buf) - usb_ep_free_buffer (ep, req->buf, req->dma, req->length); + kfree(req->buf); usb_ep_free_request (ep, req); } @@ -1199,8 +1197,7 @@ autoconf_fail: dev->req = usb_ep_alloc_request (gadget->ep0, GFP_KERNEL); if (!dev->req) goto enomem; - dev->req->buf = usb_ep_alloc_buffer (gadget->ep0, USB_BUFSIZ, - &dev->req->dma, GFP_KERNEL); + dev->req->buf = kmalloc(USB_BUFSIZ, GFP_KERNEL); if (!dev->req->buf) goto enomem; -- cgit v1.2.2