diff options
author | David Brownell <david-b@pacbell.net> | 2007-07-01 14:04:54 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-07-12 19:34:42 -0400 |
commit | 9d8bab58b758cd5a96d368a8cc64111c9ab50407 (patch) | |
tree | 710695adf1e50f2e4680c130d548ccd3e6251630 /drivers/usb/gadget/zero.c | |
parent | ad8c623f4f48085edd51c7f4cdfd10295547bf45 (diff) |
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 <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/zero.c')
-rw-r--r-- | drivers/usb/gadget/zero.c | 9 |
1 files changed, 3 insertions, 6 deletions
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) | |||
481 | req = usb_ep_alloc_request (ep, GFP_ATOMIC); | 481 | req = usb_ep_alloc_request (ep, GFP_ATOMIC); |
482 | if (req) { | 482 | if (req) { |
483 | req->length = length; | 483 | req->length = length; |
484 | req->buf = usb_ep_alloc_buffer (ep, length, | 484 | req->buf = kmalloc(length, GFP_ATOMIC); |
485 | &req->dma, GFP_ATOMIC); | ||
486 | if (!req->buf) { | 485 | if (!req->buf) { |
487 | usb_ep_free_request (ep, req); | 486 | usb_ep_free_request (ep, req); |
488 | req = NULL; | 487 | req = NULL; |
@@ -493,8 +492,7 @@ alloc_ep_req (struct usb_ep *ep, unsigned length) | |||
493 | 492 | ||
494 | static void free_ep_req (struct usb_ep *ep, struct usb_request *req) | 493 | static void free_ep_req (struct usb_ep *ep, struct usb_request *req) |
495 | { | 494 | { |
496 | if (req->buf) | 495 | kfree(req->buf); |
497 | usb_ep_free_buffer (ep, req->buf, req->dma, req->length); | ||
498 | usb_ep_free_request (ep, req); | 496 | usb_ep_free_request (ep, req); |
499 | } | 497 | } |
500 | 498 | ||
@@ -1199,8 +1197,7 @@ autoconf_fail: | |||
1199 | dev->req = usb_ep_alloc_request (gadget->ep0, GFP_KERNEL); | 1197 | dev->req = usb_ep_alloc_request (gadget->ep0, GFP_KERNEL); |
1200 | if (!dev->req) | 1198 | if (!dev->req) |
1201 | goto enomem; | 1199 | goto enomem; |
1202 | dev->req->buf = usb_ep_alloc_buffer (gadget->ep0, USB_BUFSIZ, | 1200 | dev->req->buf = kmalloc(USB_BUFSIZ, GFP_KERNEL); |
1203 | &dev->req->dma, GFP_KERNEL); | ||
1204 | if (!dev->req->buf) | 1201 | if (!dev->req->buf) |
1205 | goto enomem; | 1202 | goto enomem; |
1206 | 1203 | ||