aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/file_storage.c
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2007-07-01 14:04:54 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-12 19:34:42 -0400
commit9d8bab58b758cd5a96d368a8cc64111c9ab50407 (patch)
tree710695adf1e50f2e4680c130d548ccd3e6251630 /drivers/usb/gadget/file_storage.c
parentad8c623f4f48085edd51c7f4cdfd10295547bf45 (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/file_storage.c')
-rw-r--r--drivers/usb/gadget/file_storage.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
index 7e650d015585..8712ef987179 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -3733,19 +3733,12 @@ static void /* __init_or_exit */ fsg_unbind(struct usb_gadget *gadget)
3733 } 3733 }
3734 3734
3735 /* Free the data buffers */ 3735 /* Free the data buffers */
3736 for (i = 0; i < NUM_BUFFERS; ++i) { 3736 for (i = 0; i < NUM_BUFFERS; ++i)
3737 struct fsg_buffhd *bh = &fsg->buffhds[i]; 3737 kfree(fsg->buffhds[i].buf);
3738
3739 if (bh->buf)
3740 usb_ep_free_buffer(fsg->bulk_in, bh->buf, bh->dma,
3741 mod_data.buflen);
3742 }
3743 3738
3744 /* Free the request and buffer for endpoint 0 */ 3739 /* Free the request and buffer for endpoint 0 */
3745 if (req) { 3740 if (req) {
3746 if (req->buf) 3741 kfree(req->buf);
3747 usb_ep_free_buffer(fsg->ep0, req->buf,
3748 req->dma, EP0_BUFSIZE);
3749 usb_ep_free_request(fsg->ep0, req); 3742 usb_ep_free_request(fsg->ep0, req);
3750 } 3743 }
3751 3744
@@ -3972,8 +3965,7 @@ static int __init fsg_bind(struct usb_gadget *gadget)
3972 fsg->ep0req = req = usb_ep_alloc_request(fsg->ep0, GFP_KERNEL); 3965 fsg->ep0req = req = usb_ep_alloc_request(fsg->ep0, GFP_KERNEL);
3973 if (!req) 3966 if (!req)
3974 goto out; 3967 goto out;
3975 req->buf = usb_ep_alloc_buffer(fsg->ep0, EP0_BUFSIZE, 3968 req->buf = kmalloc(EP0_BUFSIZE, GFP_KERNEL);
3976 &req->dma, GFP_KERNEL);
3977 if (!req->buf) 3969 if (!req->buf)
3978 goto out; 3970 goto out;
3979 req->complete = ep0_complete; 3971 req->complete = ep0_complete;
@@ -3985,8 +3977,7 @@ static int __init fsg_bind(struct usb_gadget *gadget)
3985 /* Allocate for the bulk-in endpoint. We assume that 3977 /* Allocate for the bulk-in endpoint. We assume that
3986 * the buffer will also work with the bulk-out (and 3978 * the buffer will also work with the bulk-out (and
3987 * interrupt-in) endpoint. */ 3979 * interrupt-in) endpoint. */
3988 bh->buf = usb_ep_alloc_buffer(fsg->bulk_in, mod_data.buflen, 3980 bh->buf = kmalloc(mod_data.buflen, GFP_KERNEL);
3989 &bh->dma, GFP_KERNEL);
3990 if (!bh->buf) 3981 if (!bh->buf)
3991 goto out; 3982 goto out;
3992 bh->next = bh + 1; 3983 bh->next = bh + 1;