aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/DocBook/writing_usb_driver.tmpl2
-rw-r--r--Documentation/usb/dma.txt4
-rw-r--r--drivers/hid/usbhid/hid-core.c12
-rw-r--r--drivers/hid/usbhid/usbkbd.c8
-rw-r--r--drivers/hid/usbhid/usbmouse.c6
-rw-r--r--drivers/input/joystick/xpad.c16
-rw-r--r--drivers/input/misc/ati_remote.c12
-rw-r--r--drivers/input/misc/ati_remote2.c4
-rw-r--r--drivers/input/misc/cm109.c16
-rw-r--r--drivers/input/misc/keyspan_remote.c6
-rw-r--r--drivers/input/misc/powermate.c8
-rw-r--r--drivers/input/misc/yealink.c14
-rw-r--r--drivers/input/mouse/appletouch.c12
-rw-r--r--drivers/input/mouse/bcm5974.c24
-rw-r--r--drivers/input/tablet/acecad.c6
-rw-r--r--drivers/input/tablet/aiptek.c14
-rw-r--r--drivers/input/tablet/gtco.c12
-rw-r--r--drivers/input/tablet/kbtab.c6
-rw-r--r--drivers/input/tablet/wacom_sys.c10
-rw-r--r--drivers/input/touchscreen/usbtouchscreen.c8
-rw-r--r--drivers/media/dvb/dvb-usb/usb-urb.c7
-rw-r--r--drivers/media/dvb/ttusb-dec/ttusb_dec.c6
-rw-r--r--drivers/media/video/au0828/au0828-video.c4
-rw-r--r--drivers/media/video/cx231xx/cx231xx-core.c14
-rw-r--r--drivers/media/video/em28xx/em28xx-core.c4
-rw-r--r--drivers/media/video/gspca/benq.c4
-rw-r--r--drivers/media/video/gspca/gspca.c30
-rw-r--r--drivers/media/video/hdpvr/hdpvr-video.c8
-rw-r--r--drivers/media/video/tlg2300/pd-video.c14
-rw-r--r--drivers/media/video/usbvision/usbvision-core.c16
-rw-r--r--drivers/media/video/uvc/uvc_video.c4
-rw-r--r--drivers/net/can/usb/ems_usb.c18
-rw-r--r--drivers/net/usb/ipheth.c24
-rw-r--r--drivers/net/usb/kaweth.c12
-rw-r--r--drivers/net/wireless/ath/ar9170/usb.c8
-rw-r--r--drivers/net/wireless/zd1211rw/zd_usb.c10
-rw-r--r--drivers/usb/class/cdc-acm.c22
-rw-r--r--drivers/usb/class/cdc-wdm.c38
-rw-r--r--drivers/usb/class/usblp.c2
-rw-r--r--drivers/usb/misc/appledisplay.c6
-rw-r--r--drivers/usb/misc/ftdi-elan.c18
-rw-r--r--drivers/usb/misc/iowarrior.c12
-rw-r--r--drivers/usb/misc/usblcd.c8
-rw-r--r--drivers/usb/misc/usbtest.c8
-rw-r--r--drivers/usb/storage/onetouch.c12
-rw-r--r--drivers/usb/storage/usb.c4
-rw-r--r--drivers/usb/usb-skeleton.c10
-rw-r--r--drivers/watchdog/pcwd_usb.c6
-rw-r--r--sound/usb/ua101.c16
-rw-r--r--sound/usb/usbaudio.c18
-rw-r--r--sound/usb/usbmidi.c14
51 files changed, 286 insertions, 291 deletions
diff --git a/Documentation/DocBook/writing_usb_driver.tmpl b/Documentation/DocBook/writing_usb_driver.tmpl
index eeff19ca831b..bd97a13fa5ae 100644
--- a/Documentation/DocBook/writing_usb_driver.tmpl
+++ b/Documentation/DocBook/writing_usb_driver.tmpl
@@ -342,7 +342,7 @@ static inline void skel_delete (struct usb_skel *dev)
342{ 342{
343 kfree (dev->bulk_in_buffer); 343 kfree (dev->bulk_in_buffer);
344 if (dev->bulk_out_buffer != NULL) 344 if (dev->bulk_out_buffer != NULL)
345 usb_buffer_free (dev->udev, dev->bulk_out_size, 345 usb_free_coherent (dev->udev, dev->bulk_out_size,
346 dev->bulk_out_buffer, 346 dev->bulk_out_buffer,
347 dev->write_urb->transfer_dma); 347 dev->write_urb->transfer_dma);
348 usb_free_urb (dev->write_urb); 348 usb_free_urb (dev->write_urb);
diff --git a/Documentation/usb/dma.txt b/Documentation/usb/dma.txt
index cfdcd16e3abf..a37e59cf2786 100644
--- a/Documentation/usb/dma.txt
+++ b/Documentation/usb/dma.txt
@@ -43,10 +43,10 @@ and effects like cache-trashing can impose subtle penalties.
43 kind of addresses to store in urb->transfer_buffer and urb->transfer_dma. 43 kind of addresses to store in urb->transfer_buffer and urb->transfer_dma.
44 You'd also set URB_NO_TRANSFER_DMA_MAP in urb->transfer_flags: 44 You'd also set URB_NO_TRANSFER_DMA_MAP in urb->transfer_flags:
45 45
46 void *usb_buffer_alloc (struct usb_device *dev, size_t size, 46 void *usb_alloc_coherent (struct usb_device *dev, size_t size,
47 int mem_flags, dma_addr_t *dma); 47 int mem_flags, dma_addr_t *dma);
48 48
49 void usb_buffer_free (struct usb_device *dev, size_t size, 49 void usb_free_coherent (struct usb_device *dev, size_t size,
50 void *addr, dma_addr_t dma); 50 void *addr, dma_addr_t dma);
51 51
52 Most drivers should *NOT* be using these primitives; they don't need 52 Most drivers should *NOT* be using these primitives; they don't need
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 6a510c9675fc..df619756b7ae 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -783,12 +783,12 @@ static int hid_alloc_buffers(struct usb_device *dev, struct hid_device *hid)
783{ 783{
784 struct usbhid_device *usbhid = hid->driver_data; 784 struct usbhid_device *usbhid = hid->driver_data;
785 785
786 usbhid->inbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL, 786 usbhid->inbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL,
787 &usbhid->inbuf_dma); 787 &usbhid->inbuf_dma);
788 usbhid->outbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL, 788 usbhid->outbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL,
789 &usbhid->outbuf_dma); 789 &usbhid->outbuf_dma);
790 usbhid->cr = kmalloc(sizeof(*usbhid->cr), GFP_KERNEL); 790 usbhid->cr = kmalloc(sizeof(*usbhid->cr), GFP_KERNEL);
791 usbhid->ctrlbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL, 791 usbhid->ctrlbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL,
792 &usbhid->ctrlbuf_dma); 792 &usbhid->ctrlbuf_dma);
793 if (!usbhid->inbuf || !usbhid->outbuf || !usbhid->cr || 793 if (!usbhid->inbuf || !usbhid->outbuf || !usbhid->cr ||
794 !usbhid->ctrlbuf) 794 !usbhid->ctrlbuf)
@@ -843,10 +843,10 @@ static void hid_free_buffers(struct usb_device *dev, struct hid_device *hid)
843{ 843{
844 struct usbhid_device *usbhid = hid->driver_data; 844 struct usbhid_device *usbhid = hid->driver_data;
845 845
846 usb_buffer_free(dev, usbhid->bufsize, usbhid->inbuf, usbhid->inbuf_dma); 846 usb_free_coherent(dev, usbhid->bufsize, usbhid->inbuf, usbhid->inbuf_dma);
847 usb_buffer_free(dev, usbhid->bufsize, usbhid->outbuf, usbhid->outbuf_dma); 847 usb_free_coherent(dev, usbhid->bufsize, usbhid->outbuf, usbhid->outbuf_dma);
848 kfree(usbhid->cr); 848 kfree(usbhid->cr);
849 usb_buffer_free(dev, usbhid->bufsize, usbhid->ctrlbuf, usbhid->ctrlbuf_dma); 849 usb_free_coherent(dev, usbhid->bufsize, usbhid->ctrlbuf, usbhid->ctrlbuf_dma);
850} 850}
851 851
852static int usbhid_parse(struct hid_device *hid) 852static int usbhid_parse(struct hid_device *hid)
diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c
index bdc7b09e8670..bb14c8270af3 100644
--- a/drivers/hid/usbhid/usbkbd.c
+++ b/drivers/hid/usbhid/usbkbd.c
@@ -196,11 +196,11 @@ static int usb_kbd_alloc_mem(struct usb_device *dev, struct usb_kbd *kbd)
196 return -1; 196 return -1;
197 if (!(kbd->led = usb_alloc_urb(0, GFP_KERNEL))) 197 if (!(kbd->led = usb_alloc_urb(0, GFP_KERNEL)))
198 return -1; 198 return -1;
199 if (!(kbd->new = usb_buffer_alloc(dev, 8, GFP_ATOMIC, &kbd->new_dma))) 199 if (!(kbd->new = usb_alloc_coherent(dev, 8, GFP_ATOMIC, &kbd->new_dma)))
200 return -1; 200 return -1;
201 if (!(kbd->cr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL))) 201 if (!(kbd->cr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL)))
202 return -1; 202 return -1;
203 if (!(kbd->leds = usb_buffer_alloc(dev, 1, GFP_ATOMIC, &kbd->leds_dma))) 203 if (!(kbd->leds = usb_alloc_coherent(dev, 1, GFP_ATOMIC, &kbd->leds_dma)))
204 return -1; 204 return -1;
205 205
206 return 0; 206 return 0;
@@ -210,9 +210,9 @@ static void usb_kbd_free_mem(struct usb_device *dev, struct usb_kbd *kbd)
210{ 210{
211 usb_free_urb(kbd->irq); 211 usb_free_urb(kbd->irq);
212 usb_free_urb(kbd->led); 212 usb_free_urb(kbd->led);
213 usb_buffer_free(dev, 8, kbd->new, kbd->new_dma); 213 usb_free_coherent(dev, 8, kbd->new, kbd->new_dma);
214 kfree(kbd->cr); 214 kfree(kbd->cr);
215 usb_buffer_free(dev, 1, kbd->leds, kbd->leds_dma); 215 usb_free_coherent(dev, 1, kbd->leds, kbd->leds_dma);
216} 216}
217 217
218static int usb_kbd_probe(struct usb_interface *iface, 218static int usb_kbd_probe(struct usb_interface *iface,
diff --git a/drivers/hid/usbhid/usbmouse.c b/drivers/hid/usbhid/usbmouse.c
index 72ab4b268096..79b2bf81a059 100644
--- a/drivers/hid/usbhid/usbmouse.c
+++ b/drivers/hid/usbhid/usbmouse.c
@@ -142,7 +142,7 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i
142 if (!mouse || !input_dev) 142 if (!mouse || !input_dev)
143 goto fail1; 143 goto fail1;
144 144
145 mouse->data = usb_buffer_alloc(dev, 8, GFP_ATOMIC, &mouse->data_dma); 145 mouse->data = usb_alloc_coherent(dev, 8, GFP_ATOMIC, &mouse->data_dma);
146 if (!mouse->data) 146 if (!mouse->data)
147 goto fail1; 147 goto fail1;
148 148
@@ -205,7 +205,7 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i
205fail3: 205fail3:
206 usb_free_urb(mouse->irq); 206 usb_free_urb(mouse->irq);
207fail2: 207fail2:
208 usb_buffer_free(dev, 8, mouse->data, mouse->data_dma); 208 usb_free_coherent(dev, 8, mouse->data, mouse->data_dma);
209fail1: 209fail1:
210 input_free_device(input_dev); 210 input_free_device(input_dev);
211 kfree(mouse); 211 kfree(mouse);
@@ -221,7 +221,7 @@ static void usb_mouse_disconnect(struct usb_interface *intf)
221 usb_kill_urb(mouse->irq); 221 usb_kill_urb(mouse->irq);
222 input_unregister_device(mouse->dev); 222 input_unregister_device(mouse->dev);
223 usb_free_urb(mouse->irq); 223 usb_free_urb(mouse->irq);
224 usb_buffer_free(interface_to_usbdev(intf), 8, mouse->data, mouse->data_dma); 224 usb_free_coherent(interface_to_usbdev(intf), 8, mouse->data, mouse->data_dma);
225 kfree(mouse); 225 kfree(mouse);
226 } 226 }
227} 227}
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 9b3353b404da..c1087ce4cef9 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -533,8 +533,8 @@ static int xpad_init_output(struct usb_interface *intf, struct usb_xpad *xpad)
533 if (xpad->xtype != XTYPE_XBOX360 && xpad->xtype != XTYPE_XBOX) 533 if (xpad->xtype != XTYPE_XBOX360 && xpad->xtype != XTYPE_XBOX)
534 return 0; 534 return 0;
535 535
536 xpad->odata = usb_buffer_alloc(xpad->udev, XPAD_PKT_LEN, 536 xpad->odata = usb_alloc_coherent(xpad->udev, XPAD_PKT_LEN,
537 GFP_KERNEL, &xpad->odata_dma); 537 GFP_KERNEL, &xpad->odata_dma);
538 if (!xpad->odata) 538 if (!xpad->odata)
539 goto fail1; 539 goto fail1;
540 540
@@ -554,7 +554,7 @@ static int xpad_init_output(struct usb_interface *intf, struct usb_xpad *xpad)
554 554
555 return 0; 555 return 0;
556 556
557 fail2: usb_buffer_free(xpad->udev, XPAD_PKT_LEN, xpad->odata, xpad->odata_dma); 557 fail2: usb_free_coherent(xpad->udev, XPAD_PKT_LEN, xpad->odata, xpad->odata_dma);
558 fail1: return error; 558 fail1: return error;
559} 559}
560 560
@@ -568,7 +568,7 @@ static void xpad_deinit_output(struct usb_xpad *xpad)
568{ 568{
569 if (xpad->xtype == XTYPE_XBOX360 || xpad->xtype == XTYPE_XBOX) { 569 if (xpad->xtype == XTYPE_XBOX360 || xpad->xtype == XTYPE_XBOX) {
570 usb_free_urb(xpad->irq_out); 570 usb_free_urb(xpad->irq_out);
571 usb_buffer_free(xpad->udev, XPAD_PKT_LEN, 571 usb_free_coherent(xpad->udev, XPAD_PKT_LEN,
572 xpad->odata, xpad->odata_dma); 572 xpad->odata, xpad->odata_dma);
573 } 573 }
574} 574}
@@ -788,8 +788,8 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
788 if (!xpad || !input_dev) 788 if (!xpad || !input_dev)
789 goto fail1; 789 goto fail1;
790 790
791 xpad->idata = usb_buffer_alloc(udev, XPAD_PKT_LEN, 791 xpad->idata = usb_alloc_coherent(udev, XPAD_PKT_LEN,
792 GFP_KERNEL, &xpad->idata_dma); 792 GFP_KERNEL, &xpad->idata_dma);
793 if (!xpad->idata) 793 if (!xpad->idata)
794 goto fail1; 794 goto fail1;
795 795
@@ -942,7 +942,7 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
942 fail5: usb_kill_urb(xpad->irq_in); 942 fail5: usb_kill_urb(xpad->irq_in);
943 fail4: usb_free_urb(xpad->irq_in); 943 fail4: usb_free_urb(xpad->irq_in);
944 fail3: xpad_deinit_output(xpad); 944 fail3: xpad_deinit_output(xpad);
945 fail2: usb_buffer_free(udev, XPAD_PKT_LEN, xpad->idata, xpad->idata_dma); 945 fail2: usb_free_coherent(udev, XPAD_PKT_LEN, xpad->idata, xpad->idata_dma);
946 fail1: input_free_device(input_dev); 946 fail1: input_free_device(input_dev);
947 kfree(xpad); 947 kfree(xpad);
948 return error; 948 return error;
@@ -964,7 +964,7 @@ static void xpad_disconnect(struct usb_interface *intf)
964 usb_kill_urb(xpad->irq_in); 964 usb_kill_urb(xpad->irq_in);
965 } 965 }
966 usb_free_urb(xpad->irq_in); 966 usb_free_urb(xpad->irq_in);
967 usb_buffer_free(xpad->udev, XPAD_PKT_LEN, 967 usb_free_coherent(xpad->udev, XPAD_PKT_LEN,
968 xpad->idata, xpad->idata_dma); 968 xpad->idata, xpad->idata_dma);
969 kfree(xpad); 969 kfree(xpad);
970 } 970 }
diff --git a/drivers/input/misc/ati_remote.c b/drivers/input/misc/ati_remote.c
index e8bbc619f6df..bce57129afba 100644
--- a/drivers/input/misc/ati_remote.c
+++ b/drivers/input/misc/ati_remote.c
@@ -624,13 +624,13 @@ static void ati_remote_irq_in(struct urb *urb)
624static int ati_remote_alloc_buffers(struct usb_device *udev, 624static int ati_remote_alloc_buffers(struct usb_device *udev,
625 struct ati_remote *ati_remote) 625 struct ati_remote *ati_remote)
626{ 626{
627 ati_remote->inbuf = usb_buffer_alloc(udev, DATA_BUFSIZE, GFP_ATOMIC, 627 ati_remote->inbuf = usb_alloc_coherent(udev, DATA_BUFSIZE, GFP_ATOMIC,
628 &ati_remote->inbuf_dma); 628 &ati_remote->inbuf_dma);
629 if (!ati_remote->inbuf) 629 if (!ati_remote->inbuf)
630 return -1; 630 return -1;
631 631
632 ati_remote->outbuf = usb_buffer_alloc(udev, DATA_BUFSIZE, GFP_ATOMIC, 632 ati_remote->outbuf = usb_alloc_coherent(udev, DATA_BUFSIZE, GFP_ATOMIC,
633 &ati_remote->outbuf_dma); 633 &ati_remote->outbuf_dma);
634 if (!ati_remote->outbuf) 634 if (!ati_remote->outbuf)
635 return -1; 635 return -1;
636 636
@@ -653,10 +653,10 @@ static void ati_remote_free_buffers(struct ati_remote *ati_remote)
653 usb_free_urb(ati_remote->irq_urb); 653 usb_free_urb(ati_remote->irq_urb);
654 usb_free_urb(ati_remote->out_urb); 654 usb_free_urb(ati_remote->out_urb);
655 655
656 usb_buffer_free(ati_remote->udev, DATA_BUFSIZE, 656 usb_free_coherent(ati_remote->udev, DATA_BUFSIZE,
657 ati_remote->inbuf, ati_remote->inbuf_dma); 657 ati_remote->inbuf, ati_remote->inbuf_dma);
658 658
659 usb_buffer_free(ati_remote->udev, DATA_BUFSIZE, 659 usb_free_coherent(ati_remote->udev, DATA_BUFSIZE,
660 ati_remote->outbuf, ati_remote->outbuf_dma); 660 ati_remote->outbuf, ati_remote->outbuf_dma);
661} 661}
662 662
diff --git a/drivers/input/misc/ati_remote2.c b/drivers/input/misc/ati_remote2.c
index 2124b99378bb..e148749b5851 100644
--- a/drivers/input/misc/ati_remote2.c
+++ b/drivers/input/misc/ati_remote2.c
@@ -589,7 +589,7 @@ static int ati_remote2_urb_init(struct ati_remote2 *ar2)
589 int i, pipe, maxp; 589 int i, pipe, maxp;
590 590
591 for (i = 0; i < 2; i++) { 591 for (i = 0; i < 2; i++) {
592 ar2->buf[i] = usb_buffer_alloc(udev, 4, GFP_KERNEL, &ar2->buf_dma[i]); 592 ar2->buf[i] = usb_alloc_coherent(udev, 4, GFP_KERNEL, &ar2->buf_dma[i]);
593 if (!ar2->buf[i]) 593 if (!ar2->buf[i])
594 return -ENOMEM; 594 return -ENOMEM;
595 595
@@ -617,7 +617,7 @@ static void ati_remote2_urb_cleanup(struct ati_remote2 *ar2)
617 617
618 for (i = 0; i < 2; i++) { 618 for (i = 0; i < 2; i++) {
619 usb_free_urb(ar2->urb[i]); 619 usb_free_urb(ar2->urb[i]);
620 usb_buffer_free(ar2->udev, 4, ar2->buf[i], ar2->buf_dma[i]); 620 usb_free_coherent(ar2->udev, 4, ar2->buf[i], ar2->buf_dma[i]);
621 } 621 }
622} 622}
623 623
diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c
index 8d2d291ee508..2b0eba6619bd 100644
--- a/drivers/input/misc/cm109.c
+++ b/drivers/input/misc/cm109.c
@@ -630,11 +630,11 @@ static void cm109_usb_cleanup(struct cm109_dev *dev)
630{ 630{
631 kfree(dev->ctl_req); 631 kfree(dev->ctl_req);
632 if (dev->ctl_data) 632 if (dev->ctl_data)
633 usb_buffer_free(dev->udev, USB_PKT_LEN, 633 usb_free_coherent(dev->udev, USB_PKT_LEN,
634 dev->ctl_data, dev->ctl_dma); 634 dev->ctl_data, dev->ctl_dma);
635 if (dev->irq_data) 635 if (dev->irq_data)
636 usb_buffer_free(dev->udev, USB_PKT_LEN, 636 usb_free_coherent(dev->udev, USB_PKT_LEN,
637 dev->irq_data, dev->irq_dma); 637 dev->irq_data, dev->irq_dma);
638 638
639 usb_free_urb(dev->urb_irq); /* parameter validation in core/urb */ 639 usb_free_urb(dev->urb_irq); /* parameter validation in core/urb */
640 usb_free_urb(dev->urb_ctl); /* parameter validation in core/urb */ 640 usb_free_urb(dev->urb_ctl); /* parameter validation in core/urb */
@@ -683,13 +683,13 @@ static int cm109_usb_probe(struct usb_interface *intf,
683 goto err_out; 683 goto err_out;
684 684
685 /* allocate usb buffers */ 685 /* allocate usb buffers */
686 dev->irq_data = usb_buffer_alloc(udev, USB_PKT_LEN, 686 dev->irq_data = usb_alloc_coherent(udev, USB_PKT_LEN,
687 GFP_KERNEL, &dev->irq_dma); 687 GFP_KERNEL, &dev->irq_dma);
688 if (!dev->irq_data) 688 if (!dev->irq_data)
689 goto err_out; 689 goto err_out;
690 690
691 dev->ctl_data = usb_buffer_alloc(udev, USB_PKT_LEN, 691 dev->ctl_data = usb_alloc_coherent(udev, USB_PKT_LEN,
692 GFP_KERNEL, &dev->ctl_dma); 692 GFP_KERNEL, &dev->ctl_dma);
693 if (!dev->ctl_data) 693 if (!dev->ctl_data)
694 goto err_out; 694 goto err_out;
695 695
diff --git a/drivers/input/misc/keyspan_remote.c b/drivers/input/misc/keyspan_remote.c
index 86afdd1fdf9d..a93c525475c6 100644
--- a/drivers/input/misc/keyspan_remote.c
+++ b/drivers/input/misc/keyspan_remote.c
@@ -464,7 +464,7 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic
464 remote->in_endpoint = endpoint; 464 remote->in_endpoint = endpoint;
465 remote->toggle = -1; /* Set to -1 so we will always not match the toggle from the first remote message. */ 465 remote->toggle = -1; /* Set to -1 so we will always not match the toggle from the first remote message. */
466 466
467 remote->in_buffer = usb_buffer_alloc(udev, RECV_SIZE, GFP_ATOMIC, &remote->in_dma); 467 remote->in_buffer = usb_alloc_coherent(udev, RECV_SIZE, GFP_ATOMIC, &remote->in_dma);
468 if (!remote->in_buffer) { 468 if (!remote->in_buffer) {
469 error = -ENOMEM; 469 error = -ENOMEM;
470 goto fail1; 470 goto fail1;
@@ -543,7 +543,7 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic
543 return 0; 543 return 0;
544 544
545 fail3: usb_free_urb(remote->irq_urb); 545 fail3: usb_free_urb(remote->irq_urb);
546 fail2: usb_buffer_free(udev, RECV_SIZE, remote->in_buffer, remote->in_dma); 546 fail2: usb_free_coherent(udev, RECV_SIZE, remote->in_buffer, remote->in_dma);
547 fail1: kfree(remote); 547 fail1: kfree(remote);
548 input_free_device(input_dev); 548 input_free_device(input_dev);
549 549
@@ -564,7 +564,7 @@ static void keyspan_disconnect(struct usb_interface *interface)
564 input_unregister_device(remote->input); 564 input_unregister_device(remote->input);
565 usb_kill_urb(remote->irq_urb); 565 usb_kill_urb(remote->irq_urb);
566 usb_free_urb(remote->irq_urb); 566 usb_free_urb(remote->irq_urb);
567 usb_buffer_free(remote->udev, RECV_SIZE, remote->in_buffer, remote->in_dma); 567 usb_free_coherent(remote->udev, RECV_SIZE, remote->in_buffer, remote->in_dma);
568 kfree(remote); 568 kfree(remote);
569 } 569 }
570} 570}
diff --git a/drivers/input/misc/powermate.c b/drivers/input/misc/powermate.c
index 7ba4b5f53fc2..bf170f6b4422 100644
--- a/drivers/input/misc/powermate.c
+++ b/drivers/input/misc/powermate.c
@@ -273,8 +273,8 @@ static int powermate_input_event(struct input_dev *dev, unsigned int type, unsig
273 273
274static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_device *pm) 274static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_device *pm)
275{ 275{
276 pm->data = usb_buffer_alloc(udev, POWERMATE_PAYLOAD_SIZE_MAX, 276 pm->data = usb_alloc_coherent(udev, POWERMATE_PAYLOAD_SIZE_MAX,
277 GFP_ATOMIC, &pm->data_dma); 277 GFP_ATOMIC, &pm->data_dma);
278 if (!pm->data) 278 if (!pm->data)
279 return -1; 279 return -1;
280 280
@@ -287,8 +287,8 @@ static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_dev
287 287
288static void powermate_free_buffers(struct usb_device *udev, struct powermate_device *pm) 288static void powermate_free_buffers(struct usb_device *udev, struct powermate_device *pm)
289{ 289{
290 usb_buffer_free(udev, POWERMATE_PAYLOAD_SIZE_MAX, 290 usb_free_coherent(udev, POWERMATE_PAYLOAD_SIZE_MAX,
291 pm->data, pm->data_dma); 291 pm->data, pm->data_dma);
292 kfree(pm->configcr); 292 kfree(pm->configcr);
293} 293}
294 294
diff --git a/drivers/input/misc/yealink.c b/drivers/input/misc/yealink.c
index 2828328e9dd0..41201c6b5e68 100644
--- a/drivers/input/misc/yealink.c
+++ b/drivers/input/misc/yealink.c
@@ -836,10 +836,8 @@ static int usb_cleanup(struct yealink_dev *yld, int err)
836 usb_free_urb(yld->urb_ctl); 836 usb_free_urb(yld->urb_ctl);
837 837
838 kfree(yld->ctl_req); 838 kfree(yld->ctl_req);
839 usb_buffer_free(yld->udev, USB_PKT_LEN, 839 usb_free_coherent(yld->udev, USB_PKT_LEN, yld->ctl_data, yld->ctl_dma);
840 yld->ctl_data, yld->ctl_dma); 840 usb_free_coherent(yld->udev, USB_PKT_LEN, yld->irq_data, yld->irq_dma);
841 usb_buffer_free(yld->udev, USB_PKT_LEN,
842 yld->irq_data, yld->irq_dma);
843 841
844 kfree(yld); 842 kfree(yld);
845 return err; 843 return err;
@@ -884,13 +882,13 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
884 return usb_cleanup(yld, -ENOMEM); 882 return usb_cleanup(yld, -ENOMEM);
885 883
886 /* allocate usb buffers */ 884 /* allocate usb buffers */
887 yld->irq_data = usb_buffer_alloc(udev, USB_PKT_LEN, 885 yld->irq_data = usb_alloc_coherent(udev, USB_PKT_LEN,
888 GFP_ATOMIC, &yld->irq_dma); 886 GFP_ATOMIC, &yld->irq_dma);
889 if (yld->irq_data == NULL) 887 if (yld->irq_data == NULL)
890 return usb_cleanup(yld, -ENOMEM); 888 return usb_cleanup(yld, -ENOMEM);
891 889
892 yld->ctl_data = usb_buffer_alloc(udev, USB_PKT_LEN, 890 yld->ctl_data = usb_alloc_coherent(udev, USB_PKT_LEN,
893 GFP_ATOMIC, &yld->ctl_dma); 891 GFP_ATOMIC, &yld->ctl_dma);
894 if (!yld->ctl_data) 892 if (!yld->ctl_data)
895 return usb_cleanup(yld, -ENOMEM); 893 return usb_cleanup(yld, -ENOMEM);
896 894
diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c
index 53ec7ddd1826..05edd75abca0 100644
--- a/drivers/input/mouse/appletouch.c
+++ b/drivers/input/mouse/appletouch.c
@@ -806,8 +806,8 @@ static int atp_probe(struct usb_interface *iface,
806 if (!dev->urb) 806 if (!dev->urb)
807 goto err_free_devs; 807 goto err_free_devs;
808 808
809 dev->data = usb_buffer_alloc(dev->udev, dev->info->datalen, GFP_KERNEL, 809 dev->data = usb_alloc_coherent(dev->udev, dev->info->datalen, GFP_KERNEL,
810 &dev->urb->transfer_dma); 810 &dev->urb->transfer_dma);
811 if (!dev->data) 811 if (!dev->data)
812 goto err_free_urb; 812 goto err_free_urb;
813 813
@@ -862,8 +862,8 @@ static int atp_probe(struct usb_interface *iface,
862 return 0; 862 return 0;
863 863
864 err_free_buffer: 864 err_free_buffer:
865 usb_buffer_free(dev->udev, dev->info->datalen, 865 usb_free_coherent(dev->udev, dev->info->datalen,
866 dev->data, dev->urb->transfer_dma); 866 dev->data, dev->urb->transfer_dma);
867 err_free_urb: 867 err_free_urb:
868 usb_free_urb(dev->urb); 868 usb_free_urb(dev->urb);
869 err_free_devs: 869 err_free_devs:
@@ -881,8 +881,8 @@ static void atp_disconnect(struct usb_interface *iface)
881 if (dev) { 881 if (dev) {
882 usb_kill_urb(dev->urb); 882 usb_kill_urb(dev->urb);
883 input_unregister_device(dev->input); 883 input_unregister_device(dev->input);
884 usb_buffer_free(dev->udev, dev->info->datalen, 884 usb_free_coherent(dev->udev, dev->info->datalen,
885 dev->data, dev->urb->transfer_dma); 885 dev->data, dev->urb->transfer_dma);
886 usb_free_urb(dev->urb); 886 usb_free_urb(dev->urb);
887 kfree(dev); 887 kfree(dev);
888 } 888 }
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c
index b89879bd860f..6dedded27222 100644
--- a/drivers/input/mouse/bcm5974.c
+++ b/drivers/input/mouse/bcm5974.c
@@ -715,15 +715,15 @@ static int bcm5974_probe(struct usb_interface *iface,
715 if (!dev->tp_urb) 715 if (!dev->tp_urb)
716 goto err_free_bt_urb; 716 goto err_free_bt_urb;
717 717
718 dev->bt_data = usb_buffer_alloc(dev->udev, 718 dev->bt_data = usb_alloc_coherent(dev->udev,
719 dev->cfg.bt_datalen, GFP_KERNEL, 719 dev->cfg.bt_datalen, GFP_KERNEL,
720 &dev->bt_urb->transfer_dma); 720 &dev->bt_urb->transfer_dma);
721 if (!dev->bt_data) 721 if (!dev->bt_data)
722 goto err_free_urb; 722 goto err_free_urb;
723 723
724 dev->tp_data = usb_buffer_alloc(dev->udev, 724 dev->tp_data = usb_alloc_coherent(dev->udev,
725 dev->cfg.tp_datalen, GFP_KERNEL, 725 dev->cfg.tp_datalen, GFP_KERNEL,
726 &dev->tp_urb->transfer_dma); 726 &dev->tp_urb->transfer_dma);
727 if (!dev->tp_data) 727 if (!dev->tp_data)
728 goto err_free_bt_buffer; 728 goto err_free_bt_buffer;
729 729
@@ -765,10 +765,10 @@ static int bcm5974_probe(struct usb_interface *iface,
765 return 0; 765 return 0;
766 766
767err_free_buffer: 767err_free_buffer:
768 usb_buffer_free(dev->udev, dev->cfg.tp_datalen, 768 usb_free_coherent(dev->udev, dev->cfg.tp_datalen,
769 dev->tp_data, dev->tp_urb->transfer_dma); 769 dev->tp_data, dev->tp_urb->transfer_dma);
770err_free_bt_buffer: 770err_free_bt_buffer:
771 usb_buffer_free(dev->udev, dev->cfg.bt_datalen, 771 usb_free_coherent(dev->udev, dev->cfg.bt_datalen,
772 dev->bt_data, dev->bt_urb->transfer_dma); 772 dev->bt_data, dev->bt_urb->transfer_dma);
773err_free_urb: 773err_free_urb:
774 usb_free_urb(dev->tp_urb); 774 usb_free_urb(dev->tp_urb);
@@ -788,10 +788,10 @@ static void bcm5974_disconnect(struct usb_interface *iface)
788 usb_set_intfdata(iface, NULL); 788 usb_set_intfdata(iface, NULL);
789 789
790 input_unregister_device(dev->input); 790 input_unregister_device(dev->input);
791 usb_buffer_free(dev->udev, dev->cfg.tp_datalen, 791 usb_free_coherent(dev->udev, dev->cfg.tp_datalen,
792 dev->tp_data, dev->tp_urb->transfer_dma); 792 dev->tp_data, dev->tp_urb->transfer_dma);
793 usb_buffer_free(dev->udev, dev->cfg.bt_datalen, 793 usb_free_coherent(dev->udev, dev->cfg.bt_datalen,
794 dev->bt_data, dev->bt_urb->transfer_dma); 794 dev->bt_data, dev->bt_urb->transfer_dma);
795 usb_free_urb(dev->tp_urb); 795 usb_free_urb(dev->tp_urb);
796 usb_free_urb(dev->bt_urb); 796 usb_free_urb(dev->bt_urb);
797 kfree(dev); 797 kfree(dev);
diff --git a/drivers/input/tablet/acecad.c b/drivers/input/tablet/acecad.c
index 670c61c5a516..c0470163dc67 100644
--- a/drivers/input/tablet/acecad.c
+++ b/drivers/input/tablet/acecad.c
@@ -155,7 +155,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_
155 goto fail1; 155 goto fail1;
156 } 156 }
157 157
158 acecad->data = usb_buffer_alloc(dev, 8, GFP_KERNEL, &acecad->data_dma); 158 acecad->data = usb_alloc_coherent(dev, 8, GFP_KERNEL, &acecad->data_dma);
159 if (!acecad->data) { 159 if (!acecad->data) {
160 err= -ENOMEM; 160 err= -ENOMEM;
161 goto fail1; 161 goto fail1;
@@ -241,7 +241,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_
241 241
242 return 0; 242 return 0;
243 243
244 fail2: usb_buffer_free(dev, 8, acecad->data, acecad->data_dma); 244 fail2: usb_free_coherent(dev, 8, acecad->data, acecad->data_dma);
245 fail1: input_free_device(input_dev); 245 fail1: input_free_device(input_dev);
246 kfree(acecad); 246 kfree(acecad);
247 return err; 247 return err;
@@ -256,7 +256,7 @@ static void usb_acecad_disconnect(struct usb_interface *intf)
256 usb_kill_urb(acecad->irq); 256 usb_kill_urb(acecad->irq);
257 input_unregister_device(acecad->input); 257 input_unregister_device(acecad->input);
258 usb_free_urb(acecad->irq); 258 usb_free_urb(acecad->irq);
259 usb_buffer_free(interface_to_usbdev(intf), 10, acecad->data, acecad->data_dma); 259 usb_free_coherent(interface_to_usbdev(intf), 10, acecad->data, acecad->data_dma);
260 kfree(acecad); 260 kfree(acecad);
261 } 261 }
262} 262}
diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c
index 4be039d7dcad..51b80b08d467 100644
--- a/drivers/input/tablet/aiptek.c
+++ b/drivers/input/tablet/aiptek.c
@@ -1711,8 +1711,8 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
1711 goto fail1; 1711 goto fail1;
1712 } 1712 }
1713 1713
1714 aiptek->data = usb_buffer_alloc(usbdev, AIPTEK_PACKET_LENGTH, 1714 aiptek->data = usb_alloc_coherent(usbdev, AIPTEK_PACKET_LENGTH,
1715 GFP_ATOMIC, &aiptek->data_dma); 1715 GFP_ATOMIC, &aiptek->data_dma);
1716 if (!aiptek->data) { 1716 if (!aiptek->data) {
1717 dev_warn(&intf->dev, "cannot allocate usb buffer\n"); 1717 dev_warn(&intf->dev, "cannot allocate usb buffer\n");
1718 goto fail1; 1718 goto fail1;
@@ -1884,8 +1884,8 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
1884 1884
1885 fail4: sysfs_remove_group(&intf->dev.kobj, &aiptek_attribute_group); 1885 fail4: sysfs_remove_group(&intf->dev.kobj, &aiptek_attribute_group);
1886 fail3: usb_free_urb(aiptek->urb); 1886 fail3: usb_free_urb(aiptek->urb);
1887 fail2: usb_buffer_free(usbdev, AIPTEK_PACKET_LENGTH, aiptek->data, 1887 fail2: usb_free_coherent(usbdev, AIPTEK_PACKET_LENGTH, aiptek->data,
1888 aiptek->data_dma); 1888 aiptek->data_dma);
1889 fail1: usb_set_intfdata(intf, NULL); 1889 fail1: usb_set_intfdata(intf, NULL);
1890 input_free_device(inputdev); 1890 input_free_device(inputdev);
1891 kfree(aiptek); 1891 kfree(aiptek);
@@ -1909,9 +1909,9 @@ static void aiptek_disconnect(struct usb_interface *intf)
1909 input_unregister_device(aiptek->inputdev); 1909 input_unregister_device(aiptek->inputdev);
1910 sysfs_remove_group(&intf->dev.kobj, &aiptek_attribute_group); 1910 sysfs_remove_group(&intf->dev.kobj, &aiptek_attribute_group);
1911 usb_free_urb(aiptek->urb); 1911 usb_free_urb(aiptek->urb);
1912 usb_buffer_free(interface_to_usbdev(intf), 1912 usb_free_coherent(interface_to_usbdev(intf),
1913 AIPTEK_PACKET_LENGTH, 1913 AIPTEK_PACKET_LENGTH,
1914 aiptek->data, aiptek->data_dma); 1914 aiptek->data, aiptek->data_dma);
1915 kfree(aiptek); 1915 kfree(aiptek);
1916 } 1916 }
1917} 1917}
diff --git a/drivers/input/tablet/gtco.c b/drivers/input/tablet/gtco.c
index 866a9ee1af1a..8ea6afe2e992 100644
--- a/drivers/input/tablet/gtco.c
+++ b/drivers/input/tablet/gtco.c
@@ -850,8 +850,8 @@ static int gtco_probe(struct usb_interface *usbinterface,
850 gtco->usbdev = usb_get_dev(interface_to_usbdev(usbinterface)); 850 gtco->usbdev = usb_get_dev(interface_to_usbdev(usbinterface));
851 851
852 /* Allocate some data for incoming reports */ 852 /* Allocate some data for incoming reports */
853 gtco->buffer = usb_buffer_alloc(gtco->usbdev, REPORT_MAX_SIZE, 853 gtco->buffer = usb_alloc_coherent(gtco->usbdev, REPORT_MAX_SIZE,
854 GFP_KERNEL, &gtco->buf_dma); 854 GFP_KERNEL, &gtco->buf_dma);
855 if (!gtco->buffer) { 855 if (!gtco->buffer) {
856 err("No more memory for us buffers"); 856 err("No more memory for us buffers");
857 error = -ENOMEM; 857 error = -ENOMEM;
@@ -982,8 +982,8 @@ static int gtco_probe(struct usb_interface *usbinterface,
982 err_free_urb: 982 err_free_urb:
983 usb_free_urb(gtco->urbinfo); 983 usb_free_urb(gtco->urbinfo);
984 err_free_buf: 984 err_free_buf:
985 usb_buffer_free(gtco->usbdev, REPORT_MAX_SIZE, 985 usb_free_coherent(gtco->usbdev, REPORT_MAX_SIZE,
986 gtco->buffer, gtco->buf_dma); 986 gtco->buffer, gtco->buf_dma);
987 err_free_devs: 987 err_free_devs:
988 input_free_device(input_dev); 988 input_free_device(input_dev);
989 kfree(gtco); 989 kfree(gtco);
@@ -1005,8 +1005,8 @@ static void gtco_disconnect(struct usb_interface *interface)
1005 input_unregister_device(gtco->inputdevice); 1005 input_unregister_device(gtco->inputdevice);
1006 usb_kill_urb(gtco->urbinfo); 1006 usb_kill_urb(gtco->urbinfo);
1007 usb_free_urb(gtco->urbinfo); 1007 usb_free_urb(gtco->urbinfo);
1008 usb_buffer_free(gtco->usbdev, REPORT_MAX_SIZE, 1008 usb_free_coherent(gtco->usbdev, REPORT_MAX_SIZE,
1009 gtco->buffer, gtco->buf_dma); 1009 gtco->buffer, gtco->buf_dma);
1010 kfree(gtco); 1010 kfree(gtco);
1011 } 1011 }
1012 1012
diff --git a/drivers/input/tablet/kbtab.c b/drivers/input/tablet/kbtab.c
index 6682b17bf844..d31b9c793554 100644
--- a/drivers/input/tablet/kbtab.c
+++ b/drivers/input/tablet/kbtab.c
@@ -129,7 +129,7 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i
129 if (!kbtab || !input_dev) 129 if (!kbtab || !input_dev)
130 goto fail1; 130 goto fail1;
131 131
132 kbtab->data = usb_buffer_alloc(dev, 8, GFP_KERNEL, &kbtab->data_dma); 132 kbtab->data = usb_alloc_coherent(dev, 8, GFP_KERNEL, &kbtab->data_dma);
133 if (!kbtab->data) 133 if (!kbtab->data)
134 goto fail1; 134 goto fail1;
135 135
@@ -182,7 +182,7 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i
182 return 0; 182 return 0;
183 183
184 fail3: usb_free_urb(kbtab->irq); 184 fail3: usb_free_urb(kbtab->irq);
185 fail2: usb_buffer_free(dev, 10, kbtab->data, kbtab->data_dma); 185 fail2: usb_free_coherent(dev, 10, kbtab->data, kbtab->data_dma);
186 fail1: input_free_device(input_dev); 186 fail1: input_free_device(input_dev);
187 kfree(kbtab); 187 kfree(kbtab);
188 return error; 188 return error;
@@ -197,7 +197,7 @@ static void kbtab_disconnect(struct usb_interface *intf)
197 usb_kill_urb(kbtab->irq); 197 usb_kill_urb(kbtab->irq);
198 input_unregister_device(kbtab->dev); 198 input_unregister_device(kbtab->dev);
199 usb_free_urb(kbtab->irq); 199 usb_free_urb(kbtab->irq);
200 usb_buffer_free(interface_to_usbdev(intf), 10, kbtab->data, kbtab->data_dma); 200 usb_free_coherent(interface_to_usbdev(intf), 10, kbtab->data, kbtab->data_dma);
201 kfree(kbtab); 201 kfree(kbtab);
202 } 202 }
203} 203}
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index f46502589e4e..191197cd83e3 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -556,8 +556,8 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
556 goto fail1; 556 goto fail1;
557 } 557 }
558 558
559 wacom_wac->data = usb_buffer_alloc(dev, WACOM_PKGLEN_MAX, 559 wacom_wac->data = usb_alloc_coherent(dev, WACOM_PKGLEN_MAX,
560 GFP_KERNEL, &wacom->data_dma); 560 GFP_KERNEL, &wacom->data_dma);
561 if (!wacom_wac->data) { 561 if (!wacom_wac->data) {
562 error = -ENOMEM; 562 error = -ENOMEM;
563 goto fail1; 563 goto fail1;
@@ -633,7 +633,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
633 return 0; 633 return 0;
634 634
635 fail3: usb_free_urb(wacom->irq); 635 fail3: usb_free_urb(wacom->irq);
636 fail2: usb_buffer_free(dev, WACOM_PKGLEN_MAX, wacom_wac->data, wacom->data_dma); 636 fail2: usb_free_coherent(dev, WACOM_PKGLEN_MAX, wacom_wac->data, wacom->data_dma);
637 fail1: input_free_device(input_dev); 637 fail1: input_free_device(input_dev);
638 kfree(wacom); 638 kfree(wacom);
639 kfree(wacom_wac); 639 kfree(wacom_wac);
@@ -649,8 +649,8 @@ static void wacom_disconnect(struct usb_interface *intf)
649 usb_kill_urb(wacom->irq); 649 usb_kill_urb(wacom->irq);
650 input_unregister_device(wacom->dev); 650 input_unregister_device(wacom->dev);
651 usb_free_urb(wacom->irq); 651 usb_free_urb(wacom->irq);
652 usb_buffer_free(interface_to_usbdev(intf), WACOM_PKGLEN_MAX, 652 usb_free_coherent(interface_to_usbdev(intf), WACOM_PKGLEN_MAX,
653 wacom->wacom_wac->data, wacom->data_dma); 653 wacom->wacom_wac->data, wacom->data_dma);
654 kfree(wacom->wacom_wac); 654 kfree(wacom->wacom_wac);
655 kfree(wacom); 655 kfree(wacom);
656} 656}
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index 99330bbdbac7..ea41a851ddfd 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -1291,8 +1291,8 @@ static void usbtouch_close(struct input_dev *input)
1291static void usbtouch_free_buffers(struct usb_device *udev, 1291static void usbtouch_free_buffers(struct usb_device *udev,
1292 struct usbtouch_usb *usbtouch) 1292 struct usbtouch_usb *usbtouch)
1293{ 1293{
1294 usb_buffer_free(udev, usbtouch->type->rept_size, 1294 usb_free_coherent(udev, usbtouch->type->rept_size,
1295 usbtouch->data, usbtouch->data_dma); 1295 usbtouch->data, usbtouch->data_dma);
1296 kfree(usbtouch->buffer); 1296 kfree(usbtouch->buffer);
1297} 1297}
1298 1298
@@ -1336,8 +1336,8 @@ static int usbtouch_probe(struct usb_interface *intf,
1336 if (!type->process_pkt) 1336 if (!type->process_pkt)
1337 type->process_pkt = usbtouch_process_pkt; 1337 type->process_pkt = usbtouch_process_pkt;
1338 1338
1339 usbtouch->data = usb_buffer_alloc(udev, type->rept_size, 1339 usbtouch->data = usb_alloc_coherent(udev, type->rept_size,
1340 GFP_KERNEL, &usbtouch->data_dma); 1340 GFP_KERNEL, &usbtouch->data_dma);
1341 if (!usbtouch->data) 1341 if (!usbtouch->data)
1342 goto out_free; 1342 goto out_free;
1343 1343
diff --git a/drivers/media/dvb/dvb-usb/usb-urb.c b/drivers/media/dvb/dvb-usb/usb-urb.c
index f9702e3756b6..86d68933b6b4 100644
--- a/drivers/media/dvb/dvb-usb/usb-urb.c
+++ b/drivers/media/dvb/dvb-usb/usb-urb.c
@@ -96,8 +96,9 @@ static int usb_free_stream_buffers(struct usb_data_stream *stream)
96 while (stream->buf_num) { 96 while (stream->buf_num) {
97 stream->buf_num--; 97 stream->buf_num--;
98 deb_mem("freeing buffer %d\n",stream->buf_num); 98 deb_mem("freeing buffer %d\n",stream->buf_num);
99 usb_buffer_free(stream->udev, stream->buf_size, 99 usb_free_coherent(stream->udev, stream->buf_size,
100 stream->buf_list[stream->buf_num], stream->dma_addr[stream->buf_num]); 100 stream->buf_list[stream->buf_num],
101 stream->dma_addr[stream->buf_num]);
101 } 102 }
102 } 103 }
103 104
@@ -116,7 +117,7 @@ static int usb_allocate_stream_buffers(struct usb_data_stream *stream, int num,
116 for (stream->buf_num = 0; stream->buf_num < num; stream->buf_num++) { 117 for (stream->buf_num = 0; stream->buf_num < num; stream->buf_num++) {
117 deb_mem("allocating buffer %d\n",stream->buf_num); 118 deb_mem("allocating buffer %d\n",stream->buf_num);
118 if (( stream->buf_list[stream->buf_num] = 119 if (( stream->buf_list[stream->buf_num] =
119 usb_buffer_alloc(stream->udev, size, GFP_ATOMIC, 120 usb_alloc_coherent(stream->udev, size, GFP_ATOMIC,
120 &stream->dma_addr[stream->buf_num]) ) == NULL) { 121 &stream->dma_addr[stream->buf_num]) ) == NULL) {
121 deb_mem("not enough memory for urb-buffer allocation.\n"); 122 deb_mem("not enough memory for urb-buffer allocation.\n");
122 usb_free_stream_buffers(stream); 123 usb_free_stream_buffers(stream);
diff --git a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
index 53baccbab17f..fe1b8037b247 100644
--- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
@@ -1257,7 +1257,7 @@ static int ttusb_dec_init_usb(struct ttusb_dec *dec)
1257 if(!dec->irq_urb) { 1257 if(!dec->irq_urb) {
1258 return -ENOMEM; 1258 return -ENOMEM;
1259 } 1259 }
1260 dec->irq_buffer = usb_buffer_alloc(dec->udev,IRQ_PACKET_SIZE, 1260 dec->irq_buffer = usb_alloc_coherent(dec->udev,IRQ_PACKET_SIZE,
1261 GFP_ATOMIC, &dec->irq_dma_handle); 1261 GFP_ATOMIC, &dec->irq_dma_handle);
1262 if(!dec->irq_buffer) { 1262 if(!dec->irq_buffer) {
1263 usb_free_urb(dec->irq_urb); 1263 usb_free_urb(dec->irq_urb);
@@ -1550,8 +1550,8 @@ static void ttusb_dec_exit_rc(struct ttusb_dec *dec)
1550 1550
1551 usb_free_urb(dec->irq_urb); 1551 usb_free_urb(dec->irq_urb);
1552 1552
1553 usb_buffer_free(dec->udev,IRQ_PACKET_SIZE, 1553 usb_free_coherent(dec->udev,IRQ_PACKET_SIZE,
1554 dec->irq_buffer, dec->irq_dma_handle); 1554 dec->irq_buffer, dec->irq_dma_handle);
1555 1555
1556 if (dec->rc_input_dev) { 1556 if (dec->rc_input_dev) {
1557 input_unregister_device(dec->rc_input_dev); 1557 input_unregister_device(dec->rc_input_dev);
diff --git a/drivers/media/video/au0828/au0828-video.c b/drivers/media/video/au0828/au0828-video.c
index 8c140c01c5e6..a2a0f79a84f3 100644
--- a/drivers/media/video/au0828/au0828-video.c
+++ b/drivers/media/video/au0828/au0828-video.c
@@ -177,7 +177,7 @@ void au0828_uninit_isoc(struct au0828_dev *dev)
177 usb_unlink_urb(urb); 177 usb_unlink_urb(urb);
178 178
179 if (dev->isoc_ctl.transfer_buffer[i]) { 179 if (dev->isoc_ctl.transfer_buffer[i]) {
180 usb_buffer_free(dev->usbdev, 180 usb_free_coherent(dev->usbdev,
181 urb->transfer_buffer_length, 181 urb->transfer_buffer_length,
182 dev->isoc_ctl.transfer_buffer[i], 182 dev->isoc_ctl.transfer_buffer[i],
183 urb->transfer_dma); 183 urb->transfer_dma);
@@ -247,7 +247,7 @@ int au0828_init_isoc(struct au0828_dev *dev, int max_packets,
247 } 247 }
248 dev->isoc_ctl.urb[i] = urb; 248 dev->isoc_ctl.urb[i] = urb;
249 249
250 dev->isoc_ctl.transfer_buffer[i] = usb_buffer_alloc(dev->usbdev, 250 dev->isoc_ctl.transfer_buffer[i] = usb_alloc_coherent(dev->usbdev,
251 sb_size, GFP_KERNEL, &urb->transfer_dma); 251 sb_size, GFP_KERNEL, &urb->transfer_dma);
252 if (!dev->isoc_ctl.transfer_buffer[i]) { 252 if (!dev->isoc_ctl.transfer_buffer[i]) {
253 printk("unable to allocate %i bytes for transfer" 253 printk("unable to allocate %i bytes for transfer"
diff --git a/drivers/media/video/cx231xx/cx231xx-core.c b/drivers/media/video/cx231xx/cx231xx-core.c
index b24eee115e7e..6ccd87d5fb98 100644
--- a/drivers/media/video/cx231xx/cx231xx-core.c
+++ b/drivers/media/video/cx231xx/cx231xx-core.c
@@ -679,11 +679,11 @@ void cx231xx_uninit_isoc(struct cx231xx *dev)
679 usb_unlink_urb(urb); 679 usb_unlink_urb(urb);
680 680
681 if (dev->video_mode.isoc_ctl.transfer_buffer[i]) { 681 if (dev->video_mode.isoc_ctl.transfer_buffer[i]) {
682 usb_buffer_free(dev->udev, 682 usb_free_coherent(dev->udev,
683 urb->transfer_buffer_length, 683 urb->transfer_buffer_length,
684 dev->video_mode.isoc_ctl. 684 dev->video_mode.isoc_ctl.
685 transfer_buffer[i], 685 transfer_buffer[i],
686 urb->transfer_dma); 686 urb->transfer_dma);
687 } 687 }
688 usb_free_urb(urb); 688 usb_free_urb(urb);
689 dev->video_mode.isoc_ctl.urb[i] = NULL; 689 dev->video_mode.isoc_ctl.urb[i] = NULL;
@@ -770,8 +770,8 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets,
770 dev->video_mode.isoc_ctl.urb[i] = urb; 770 dev->video_mode.isoc_ctl.urb[i] = urb;
771 771
772 dev->video_mode.isoc_ctl.transfer_buffer[i] = 772 dev->video_mode.isoc_ctl.transfer_buffer[i] =
773 usb_buffer_alloc(dev->udev, sb_size, GFP_KERNEL, 773 usb_alloc_coherent(dev->udev, sb_size, GFP_KERNEL,
774 &urb->transfer_dma); 774 &urb->transfer_dma);
775 if (!dev->video_mode.isoc_ctl.transfer_buffer[i]) { 775 if (!dev->video_mode.isoc_ctl.transfer_buffer[i]) {
776 cx231xx_err("unable to allocate %i bytes for transfer" 776 cx231xx_err("unable to allocate %i bytes for transfer"
777 " buffer %i%s\n", 777 " buffer %i%s\n",
diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c
index a41cc5566778..d4a95546504d 100644
--- a/drivers/media/video/em28xx/em28xx-core.c
+++ b/drivers/media/video/em28xx/em28xx-core.c
@@ -966,7 +966,7 @@ void em28xx_uninit_isoc(struct em28xx *dev)
966 usb_unlink_urb(urb); 966 usb_unlink_urb(urb);
967 967
968 if (dev->isoc_ctl.transfer_buffer[i]) { 968 if (dev->isoc_ctl.transfer_buffer[i]) {
969 usb_buffer_free(dev->udev, 969 usb_free_coherent(dev->udev,
970 urb->transfer_buffer_length, 970 urb->transfer_buffer_length,
971 dev->isoc_ctl.transfer_buffer[i], 971 dev->isoc_ctl.transfer_buffer[i],
972 urb->transfer_dma); 972 urb->transfer_dma);
@@ -1041,7 +1041,7 @@ int em28xx_init_isoc(struct em28xx *dev, int max_packets,
1041 } 1041 }
1042 dev->isoc_ctl.urb[i] = urb; 1042 dev->isoc_ctl.urb[i] = urb;
1043 1043
1044 dev->isoc_ctl.transfer_buffer[i] = usb_buffer_alloc(dev->udev, 1044 dev->isoc_ctl.transfer_buffer[i] = usb_alloc_coherent(dev->udev,
1045 sb_size, GFP_KERNEL, &urb->transfer_dma); 1045 sb_size, GFP_KERNEL, &urb->transfer_dma);
1046 if (!dev->isoc_ctl.transfer_buffer[i]) { 1046 if (!dev->isoc_ctl.transfer_buffer[i]) {
1047 em28xx_err("unable to allocate %i bytes for transfer" 1047 em28xx_err("unable to allocate %i bytes for transfer"
diff --git a/drivers/media/video/gspca/benq.c b/drivers/media/video/gspca/benq.c
index 43ac4af8d3ed..fce8d9492641 100644
--- a/drivers/media/video/gspca/benq.c
+++ b/drivers/media/video/gspca/benq.c
@@ -117,13 +117,13 @@ static int sd_start(struct gspca_dev *gspca_dev)
117 return -ENOMEM; 117 return -ENOMEM;
118 } 118 }
119 gspca_dev->urb[n] = urb; 119 gspca_dev->urb[n] = urb;
120 urb->transfer_buffer = usb_buffer_alloc(gspca_dev->dev, 120 urb->transfer_buffer = usb_alloc_coherent(gspca_dev->dev,
121 SD_PKT_SZ * SD_NPKT, 121 SD_PKT_SZ * SD_NPKT,
122 GFP_KERNEL, 122 GFP_KERNEL,
123 &urb->transfer_dma); 123 &urb->transfer_dma);
124 124
125 if (urb->transfer_buffer == NULL) { 125 if (urb->transfer_buffer == NULL) {
126 err("usb_buffer_alloc failed"); 126 err("usb_alloc_coherent failed");
127 return -ENOMEM; 127 return -ENOMEM;
128 } 128 }
129 urb->dev = gspca_dev->dev; 129 urb->dev = gspca_dev->dev;
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index 222af479150b..00713f81d1e2 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -213,7 +213,7 @@ static int alloc_and_submit_int_urb(struct gspca_dev *gspca_dev,
213 goto error; 213 goto error;
214 } 214 }
215 215
216 buffer = usb_buffer_alloc(dev, ep->wMaxPacketSize, 216 buffer = usb_alloc_coherent(dev, ep->wMaxPacketSize,
217 GFP_KERNEL, &urb->transfer_dma); 217 GFP_KERNEL, &urb->transfer_dma);
218 if (!buffer) { 218 if (!buffer) {
219 ret = -ENOMEM; 219 ret = -ENOMEM;
@@ -232,10 +232,10 @@ static int alloc_and_submit_int_urb(struct gspca_dev *gspca_dev,
232 return ret; 232 return ret;
233 233
234error_submit: 234error_submit:
235 usb_buffer_free(dev, 235 usb_free_coherent(dev,
236 urb->transfer_buffer_length, 236 urb->transfer_buffer_length,
237 urb->transfer_buffer, 237 urb->transfer_buffer,
238 urb->transfer_dma); 238 urb->transfer_dma);
239error_buffer: 239error_buffer:
240 usb_free_urb(urb); 240 usb_free_urb(urb);
241error: 241error:
@@ -272,10 +272,10 @@ static void gspca_input_destroy_urb(struct gspca_dev *gspca_dev)
272 if (urb) { 272 if (urb) {
273 gspca_dev->int_urb = NULL; 273 gspca_dev->int_urb = NULL;
274 usb_kill_urb(urb); 274 usb_kill_urb(urb);
275 usb_buffer_free(gspca_dev->dev, 275 usb_free_coherent(gspca_dev->dev,
276 urb->transfer_buffer_length, 276 urb->transfer_buffer_length,
277 urb->transfer_buffer, 277 urb->transfer_buffer,
278 urb->transfer_dma); 278 urb->transfer_dma);
279 usb_free_urb(urb); 279 usb_free_urb(urb);
280 } 280 }
281} 281}
@@ -597,10 +597,10 @@ static void destroy_urbs(struct gspca_dev *gspca_dev)
597 gspca_dev->urb[i] = NULL; 597 gspca_dev->urb[i] = NULL;
598 usb_kill_urb(urb); 598 usb_kill_urb(urb);
599 if (urb->transfer_buffer != NULL) 599 if (urb->transfer_buffer != NULL)
600 usb_buffer_free(gspca_dev->dev, 600 usb_free_coherent(gspca_dev->dev,
601 urb->transfer_buffer_length, 601 urb->transfer_buffer_length,
602 urb->transfer_buffer, 602 urb->transfer_buffer,
603 urb->transfer_dma); 603 urb->transfer_dma);
604 usb_free_urb(urb); 604 usb_free_urb(urb);
605 } 605 }
606} 606}
@@ -721,13 +721,13 @@ static int create_urbs(struct gspca_dev *gspca_dev,
721 return -ENOMEM; 721 return -ENOMEM;
722 } 722 }
723 gspca_dev->urb[n] = urb; 723 gspca_dev->urb[n] = urb;
724 urb->transfer_buffer = usb_buffer_alloc(gspca_dev->dev, 724 urb->transfer_buffer = usb_alloc_coherent(gspca_dev->dev,
725 bsize, 725 bsize,
726 GFP_KERNEL, 726 GFP_KERNEL,
727 &urb->transfer_dma); 727 &urb->transfer_dma);
728 728
729 if (urb->transfer_buffer == NULL) { 729 if (urb->transfer_buffer == NULL) {
730 err("usb_buffer_alloc failed"); 730 err("usb_alloc_coherent failed");
731 return -ENOMEM; 731 return -ENOMEM;
732 } 732 }
733 urb->dev = gspca_dev->dev; 733 urb->dev = gspca_dev->dev;
diff --git a/drivers/media/video/hdpvr/hdpvr-video.c b/drivers/media/video/hdpvr/hdpvr-video.c
index 196f82de48f0..b65efe25b31d 100644
--- a/drivers/media/video/hdpvr/hdpvr-video.c
+++ b/drivers/media/video/hdpvr/hdpvr-video.c
@@ -92,8 +92,8 @@ static int hdpvr_free_queue(struct list_head *q)
92 buf = list_entry(p, struct hdpvr_buffer, buff_list); 92 buf = list_entry(p, struct hdpvr_buffer, buff_list);
93 93
94 urb = buf->urb; 94 urb = buf->urb;
95 usb_buffer_free(urb->dev, urb->transfer_buffer_length, 95 usb_free_coherent(urb->dev, urb->transfer_buffer_length,
96 urb->transfer_buffer, urb->transfer_dma); 96 urb->transfer_buffer, urb->transfer_dma);
97 usb_free_urb(urb); 97 usb_free_urb(urb);
98 tmp = p->next; 98 tmp = p->next;
99 list_del(p); 99 list_del(p);
@@ -143,8 +143,8 @@ int hdpvr_alloc_buffers(struct hdpvr_device *dev, uint count)
143 } 143 }
144 buf->urb = urb; 144 buf->urb = urb;
145 145
146 mem = usb_buffer_alloc(dev->udev, dev->bulk_in_size, GFP_KERNEL, 146 mem = usb_alloc_coherent(dev->udev, dev->bulk_in_size, GFP_KERNEL,
147 &urb->transfer_dma); 147 &urb->transfer_dma);
148 if (!mem) { 148 if (!mem) {
149 v4l2_err(&dev->v4l2_dev, 149 v4l2_err(&dev->v4l2_dev,
150 "cannot allocate usb transfer buffer\n"); 150 "cannot allocate usb transfer buffer\n");
diff --git a/drivers/media/video/tlg2300/pd-video.c b/drivers/media/video/tlg2300/pd-video.c
index cf8f18c007e6..7bc29065e1ad 100644
--- a/drivers/media/video/tlg2300/pd-video.c
+++ b/drivers/media/video/tlg2300/pd-video.c
@@ -476,10 +476,10 @@ static int prepare_iso_urb(struct video_data *video)
476 goto out; 476 goto out;
477 477
478 video->urb_array[i] = urb; 478 video->urb_array[i] = urb;
479 mem = usb_buffer_alloc(udev, 479 mem = usb_alloc_coherent(udev,
480 ISO_PKT_SIZE * PK_PER_URB, 480 ISO_PKT_SIZE * PK_PER_URB,
481 GFP_KERNEL, 481 GFP_KERNEL,
482 &urb->transfer_dma); 482 &urb->transfer_dma);
483 483
484 urb->complete = urb_complete_iso; /* handler */ 484 urb->complete = urb_complete_iso; /* handler */
485 urb->dev = udev; 485 urb->dev = udev;
@@ -519,8 +519,8 @@ int alloc_bulk_urbs_generic(struct urb **urb_array, int num,
519 if (urb == NULL) 519 if (urb == NULL)
520 return i; 520 return i;
521 521
522 mem = usb_buffer_alloc(udev, buf_size, gfp_flags, 522 mem = usb_alloc_coherent(udev, buf_size, gfp_flags,
523 &urb->transfer_dma); 523 &urb->transfer_dma);
524 if (mem == NULL) 524 if (mem == NULL)
525 return i; 525 return i;
526 526
@@ -540,7 +540,7 @@ void free_all_urb_generic(struct urb **urb_array, int num)
540 for (i = 0; i < num; i++) { 540 for (i = 0; i < num; i++) {
541 urb = urb_array[i]; 541 urb = urb_array[i];
542 if (urb) { 542 if (urb) {
543 usb_buffer_free(urb->dev, 543 usb_free_coherent(urb->dev,
544 urb->transfer_buffer_length, 544 urb->transfer_buffer_length,
545 urb->transfer_buffer, 545 urb->transfer_buffer,
546 urb->transfer_dma); 546 urb->transfer_dma);
diff --git a/drivers/media/video/usbvision/usbvision-core.c b/drivers/media/video/usbvision/usbvision-core.c
index f7aae2293758..b9dd74fde212 100644
--- a/drivers/media/video/usbvision/usbvision-core.c
+++ b/drivers/media/video/usbvision/usbvision-core.c
@@ -2493,10 +2493,10 @@ int usbvision_init_isoc(struct usb_usbvision *usbvision)
2493 } 2493 }
2494 usbvision->sbuf[bufIdx].urb = urb; 2494 usbvision->sbuf[bufIdx].urb = urb;
2495 usbvision->sbuf[bufIdx].data = 2495 usbvision->sbuf[bufIdx].data =
2496 usb_buffer_alloc(usbvision->dev, 2496 usb_alloc_coherent(usbvision->dev,
2497 sb_size, 2497 sb_size,
2498 GFP_KERNEL, 2498 GFP_KERNEL,
2499 &urb->transfer_dma); 2499 &urb->transfer_dma);
2500 urb->dev = dev; 2500 urb->dev = dev;
2501 urb->context = usbvision; 2501 urb->context = usbvision;
2502 urb->pipe = usb_rcvisocpipe(dev, usbvision->video_endp); 2502 urb->pipe = usb_rcvisocpipe(dev, usbvision->video_endp);
@@ -2552,10 +2552,10 @@ void usbvision_stop_isoc(struct usb_usbvision *usbvision)
2552 for (bufIdx = 0; bufIdx < USBVISION_NUMSBUF; bufIdx++) { 2552 for (bufIdx = 0; bufIdx < USBVISION_NUMSBUF; bufIdx++) {
2553 usb_kill_urb(usbvision->sbuf[bufIdx].urb); 2553 usb_kill_urb(usbvision->sbuf[bufIdx].urb);
2554 if (usbvision->sbuf[bufIdx].data){ 2554 if (usbvision->sbuf[bufIdx].data){
2555 usb_buffer_free(usbvision->dev, 2555 usb_free_coherent(usbvision->dev,
2556 sb_size, 2556 sb_size,
2557 usbvision->sbuf[bufIdx].data, 2557 usbvision->sbuf[bufIdx].data,
2558 usbvision->sbuf[bufIdx].urb->transfer_dma); 2558 usbvision->sbuf[bufIdx].urb->transfer_dma);
2559 } 2559 }
2560 usb_free_urb(usbvision->sbuf[bufIdx].urb); 2560 usb_free_urb(usbvision->sbuf[bufIdx].urb);
2561 usbvision->sbuf[bufIdx].urb = NULL; 2561 usbvision->sbuf[bufIdx].urb = NULL;
diff --git a/drivers/media/video/uvc/uvc_video.c b/drivers/media/video/uvc/uvc_video.c
index 821a9969b7bf..53f3ef4635eb 100644
--- a/drivers/media/video/uvc/uvc_video.c
+++ b/drivers/media/video/uvc/uvc_video.c
@@ -739,7 +739,7 @@ static void uvc_free_urb_buffers(struct uvc_streaming *stream)
739 739
740 for (i = 0; i < UVC_URBS; ++i) { 740 for (i = 0; i < UVC_URBS; ++i) {
741 if (stream->urb_buffer[i]) { 741 if (stream->urb_buffer[i]) {
742 usb_buffer_free(stream->dev->udev, stream->urb_size, 742 usb_free_coherent(stream->dev->udev, stream->urb_size,
743 stream->urb_buffer[i], stream->urb_dma[i]); 743 stream->urb_buffer[i], stream->urb_dma[i]);
744 stream->urb_buffer[i] = NULL; 744 stream->urb_buffer[i] = NULL;
745 } 745 }
@@ -780,7 +780,7 @@ static int uvc_alloc_urb_buffers(struct uvc_streaming *stream,
780 for (; npackets > 1; npackets /= 2) { 780 for (; npackets > 1; npackets /= 2) {
781 for (i = 0; i < UVC_URBS; ++i) { 781 for (i = 0; i < UVC_URBS; ++i) {
782 stream->urb_size = psize * npackets; 782 stream->urb_size = psize * npackets;
783 stream->urb_buffer[i] = usb_buffer_alloc( 783 stream->urb_buffer[i] = usb_alloc_coherent(
784 stream->dev->udev, stream->urb_size, 784 stream->dev->udev, stream->urb_size,
785 gfp_flags | __GFP_NOWARN, &stream->urb_dma[i]); 785 gfp_flags | __GFP_NOWARN, &stream->urb_dma[i]);
786 if (!stream->urb_buffer[i]) { 786 if (!stream->urb_buffer[i]) {
diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c
index d800b598ae3d..25a5c7eea948 100644
--- a/drivers/net/can/usb/ems_usb.c
+++ b/drivers/net/can/usb/ems_usb.c
@@ -516,8 +516,8 @@ static void ems_usb_write_bulk_callback(struct urb *urb)
516 netdev = dev->netdev; 516 netdev = dev->netdev;
517 517
518 /* free up our allocated buffer */ 518 /* free up our allocated buffer */
519 usb_buffer_free(urb->dev, urb->transfer_buffer_length, 519 usb_free_coherent(urb->dev, urb->transfer_buffer_length,
520 urb->transfer_buffer, urb->transfer_dma); 520 urb->transfer_buffer, urb->transfer_dma);
521 521
522 atomic_dec(&dev->active_tx_urbs); 522 atomic_dec(&dev->active_tx_urbs);
523 523
@@ -614,8 +614,8 @@ static int ems_usb_start(struct ems_usb *dev)
614 return -ENOMEM; 614 return -ENOMEM;
615 } 615 }
616 616
617 buf = usb_buffer_alloc(dev->udev, RX_BUFFER_SIZE, GFP_KERNEL, 617 buf = usb_alloc_coherent(dev->udev, RX_BUFFER_SIZE, GFP_KERNEL,
618 &urb->transfer_dma); 618 &urb->transfer_dma);
619 if (!buf) { 619 if (!buf) {
620 dev_err(netdev->dev.parent, 620 dev_err(netdev->dev.parent,
621 "No memory left for USB buffer\n"); 621 "No memory left for USB buffer\n");
@@ -635,8 +635,8 @@ static int ems_usb_start(struct ems_usb *dev)
635 netif_device_detach(dev->netdev); 635 netif_device_detach(dev->netdev);
636 636
637 usb_unanchor_urb(urb); 637 usb_unanchor_urb(urb);
638 usb_buffer_free(dev->udev, RX_BUFFER_SIZE, buf, 638 usb_free_coherent(dev->udev, RX_BUFFER_SIZE, buf,
639 urb->transfer_dma); 639 urb->transfer_dma);
640 break; 640 break;
641 } 641 }
642 642
@@ -777,7 +777,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne
777 goto nomem; 777 goto nomem;
778 } 778 }
779 779
780 buf = usb_buffer_alloc(dev->udev, size, GFP_ATOMIC, &urb->transfer_dma); 780 buf = usb_alloc_coherent(dev->udev, size, GFP_ATOMIC, &urb->transfer_dma);
781 if (!buf) { 781 if (!buf) {
782 dev_err(netdev->dev.parent, "No memory left for USB buffer\n"); 782 dev_err(netdev->dev.parent, "No memory left for USB buffer\n");
783 usb_free_urb(urb); 783 usb_free_urb(urb);
@@ -820,7 +820,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne
820 */ 820 */
821 if (!context) { 821 if (!context) {
822 usb_unanchor_urb(urb); 822 usb_unanchor_urb(urb);
823 usb_buffer_free(dev->udev, size, buf, urb->transfer_dma); 823 usb_free_coherent(dev->udev, size, buf, urb->transfer_dma);
824 824
825 dev_warn(netdev->dev.parent, "couldn't find free context\n"); 825 dev_warn(netdev->dev.parent, "couldn't find free context\n");
826 826
@@ -845,7 +845,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne
845 can_free_echo_skb(netdev, context->echo_index); 845 can_free_echo_skb(netdev, context->echo_index);
846 846
847 usb_unanchor_urb(urb); 847 usb_unanchor_urb(urb);
848 usb_buffer_free(dev->udev, size, buf, urb->transfer_dma); 848 usb_free_coherent(dev->udev, size, buf, urb->transfer_dma);
849 dev_kfree_skb(skb); 849 dev_kfree_skb(skb);
850 850
851 atomic_dec(&dev->active_tx_urbs); 851 atomic_dec(&dev->active_tx_urbs);
diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
index 418825d26f90..197c352c47fb 100644
--- a/drivers/net/usb/ipheth.c
+++ b/drivers/net/usb/ipheth.c
@@ -128,17 +128,13 @@ static int ipheth_alloc_urbs(struct ipheth_device *iphone)
128 if (rx_urb == NULL) 128 if (rx_urb == NULL)
129 goto free_tx_urb; 129 goto free_tx_urb;
130 130
131 tx_buf = usb_buffer_alloc(iphone->udev, 131 tx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE,
132 IPHETH_BUF_SIZE, 132 GFP_KERNEL, &tx_urb->transfer_dma);
133 GFP_KERNEL,
134 &tx_urb->transfer_dma);
135 if (tx_buf == NULL) 133 if (tx_buf == NULL)
136 goto free_rx_urb; 134 goto free_rx_urb;
137 135
138 rx_buf = usb_buffer_alloc(iphone->udev, 136 rx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE,
139 IPHETH_BUF_SIZE, 137 GFP_KERNEL, &rx_urb->transfer_dma);
140 GFP_KERNEL,
141 &rx_urb->transfer_dma);
142 if (rx_buf == NULL) 138 if (rx_buf == NULL)
143 goto free_tx_buf; 139 goto free_tx_buf;
144 140
@@ -150,8 +146,8 @@ static int ipheth_alloc_urbs(struct ipheth_device *iphone)
150 return 0; 146 return 0;
151 147
152free_tx_buf: 148free_tx_buf:
153 usb_buffer_free(iphone->udev, IPHETH_BUF_SIZE, tx_buf, 149 usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, tx_buf,
154 tx_urb->transfer_dma); 150 tx_urb->transfer_dma);
155free_rx_urb: 151free_rx_urb:
156 usb_free_urb(rx_urb); 152 usb_free_urb(rx_urb);
157free_tx_urb: 153free_tx_urb:
@@ -162,10 +158,10 @@ error_nomem:
162 158
163static void ipheth_free_urbs(struct ipheth_device *iphone) 159static void ipheth_free_urbs(struct ipheth_device *iphone)
164{ 160{
165 usb_buffer_free(iphone->udev, IPHETH_BUF_SIZE, iphone->rx_buf, 161 usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->rx_buf,
166 iphone->rx_urb->transfer_dma); 162 iphone->rx_urb->transfer_dma);
167 usb_buffer_free(iphone->udev, IPHETH_BUF_SIZE, iphone->tx_buf, 163 usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->tx_buf,
168 iphone->tx_urb->transfer_dma); 164 iphone->tx_urb->transfer_dma);
169 usb_free_urb(iphone->rx_urb); 165 usb_free_urb(iphone->rx_urb);
170 usb_free_urb(iphone->tx_urb); 166 usb_free_urb(iphone->tx_urb);
171} 167}
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
index c4c334d9770f..a3eb7be51d53 100644
--- a/drivers/net/usb/kaweth.c
+++ b/drivers/net/usb/kaweth.c
@@ -1156,13 +1156,13 @@ err_fw:
1156 if (!kaweth->irq_urb) 1156 if (!kaweth->irq_urb)
1157 goto err_tx_and_rx; 1157 goto err_tx_and_rx;
1158 1158
1159 kaweth->intbuffer = usb_buffer_alloc( kaweth->dev, 1159 kaweth->intbuffer = usb_alloc_coherent( kaweth->dev,
1160 INTBUFFERSIZE, 1160 INTBUFFERSIZE,
1161 GFP_KERNEL, 1161 GFP_KERNEL,
1162 &kaweth->intbufferhandle); 1162 &kaweth->intbufferhandle);
1163 if (!kaweth->intbuffer) 1163 if (!kaweth->intbuffer)
1164 goto err_tx_and_rx_and_irq; 1164 goto err_tx_and_rx_and_irq;
1165 kaweth->rx_buf = usb_buffer_alloc( kaweth->dev, 1165 kaweth->rx_buf = usb_alloc_coherent( kaweth->dev,
1166 KAWETH_BUF_SIZE, 1166 KAWETH_BUF_SIZE,
1167 GFP_KERNEL, 1167 GFP_KERNEL,
1168 &kaweth->rxbufferhandle); 1168 &kaweth->rxbufferhandle);
@@ -1203,9 +1203,9 @@ err_fw:
1203 1203
1204err_intfdata: 1204err_intfdata:
1205 usb_set_intfdata(intf, NULL); 1205 usb_set_intfdata(intf, NULL);
1206 usb_buffer_free(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle); 1206 usb_free_coherent(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle);
1207err_all_but_rxbuf: 1207err_all_but_rxbuf:
1208 usb_buffer_free(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle); 1208 usb_free_coherent(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle);
1209err_tx_and_rx_and_irq: 1209err_tx_and_rx_and_irq:
1210 usb_free_urb(kaweth->irq_urb); 1210 usb_free_urb(kaweth->irq_urb);
1211err_tx_and_rx: 1211err_tx_and_rx:
@@ -1242,8 +1242,8 @@ static void kaweth_disconnect(struct usb_interface *intf)
1242 usb_free_urb(kaweth->tx_urb); 1242 usb_free_urb(kaweth->tx_urb);
1243 usb_free_urb(kaweth->irq_urb); 1243 usb_free_urb(kaweth->irq_urb);
1244 1244
1245 usb_buffer_free(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle); 1245 usb_free_coherent(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle);
1246 usb_buffer_free(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle); 1246 usb_free_coherent(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle);
1247 1247
1248 free_netdev(netdev); 1248 free_netdev(netdev);
1249} 1249}
diff --git a/drivers/net/wireless/ath/ar9170/usb.c b/drivers/net/wireless/ath/ar9170/usb.c
index e1c2fcaa8bed..a1f5444f7ccd 100644
--- a/drivers/net/wireless/ath/ar9170/usb.c
+++ b/drivers/net/wireless/ath/ar9170/usb.c
@@ -202,7 +202,7 @@ resubmit:
202 return; 202 return;
203 203
204free: 204free:
205 usb_buffer_free(aru->udev, 64, urb->transfer_buffer, urb->transfer_dma); 205 usb_free_coherent(aru->udev, 64, urb->transfer_buffer, urb->transfer_dma);
206} 206}
207 207
208static void ar9170_usb_rx_completed(struct urb *urb) 208static void ar9170_usb_rx_completed(struct urb *urb)
@@ -283,7 +283,7 @@ static int ar9170_usb_alloc_rx_irq_urb(struct ar9170_usb *aru)
283 if (!urb) 283 if (!urb)
284 goto out; 284 goto out;
285 285
286 ibuf = usb_buffer_alloc(aru->udev, 64, GFP_KERNEL, &urb->transfer_dma); 286 ibuf = usb_alloc_coherent(aru->udev, 64, GFP_KERNEL, &urb->transfer_dma);
287 if (!ibuf) 287 if (!ibuf)
288 goto out; 288 goto out;
289 289
@@ -296,8 +296,8 @@ static int ar9170_usb_alloc_rx_irq_urb(struct ar9170_usb *aru)
296 err = usb_submit_urb(urb, GFP_KERNEL); 296 err = usb_submit_urb(urb, GFP_KERNEL);
297 if (err) { 297 if (err) {
298 usb_unanchor_urb(urb); 298 usb_unanchor_urb(urb);
299 usb_buffer_free(aru->udev, 64, urb->transfer_buffer, 299 usb_free_coherent(aru->udev, 64, urb->transfer_buffer,
300 urb->transfer_dma); 300 urb->transfer_dma);
301 } 301 }
302 302
303out: 303out:
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c
index d91ad1a612af..c257940b71b6 100644
--- a/drivers/net/wireless/zd1211rw/zd_usb.c
+++ b/drivers/net/wireless/zd1211rw/zd_usb.c
@@ -664,15 +664,15 @@ static struct urb *alloc_rx_urb(struct zd_usb *usb)
664 urb = usb_alloc_urb(0, GFP_KERNEL); 664 urb = usb_alloc_urb(0, GFP_KERNEL);
665 if (!urb) 665 if (!urb)
666 return NULL; 666 return NULL;
667 buffer = usb_buffer_alloc(udev, USB_MAX_RX_SIZE, GFP_KERNEL, 667 buffer = usb_alloc_coherent(udev, USB_MAX_RX_SIZE, GFP_KERNEL,
668 &urb->transfer_dma); 668 &urb->transfer_dma);
669 if (!buffer) { 669 if (!buffer) {
670 usb_free_urb(urb); 670 usb_free_urb(urb);
671 return NULL; 671 return NULL;
672 } 672 }
673 673
674 usb_fill_bulk_urb(urb, udev, usb_rcvbulkpipe(udev, EP_DATA_IN), 674 usb_fill_bulk_urb(urb, udev, usb_rcvbulkpipe(udev, EP_DATA_IN),
675 buffer, USB_MAX_RX_SIZE, 675 buffer, USB_MAX_RX_SIZE,
676 rx_urb_complete, usb); 676 rx_urb_complete, usb);
677 urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; 677 urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
678 678
@@ -683,8 +683,8 @@ static void free_rx_urb(struct urb *urb)
683{ 683{
684 if (!urb) 684 if (!urb)
685 return; 685 return;
686 usb_buffer_free(urb->dev, urb->transfer_buffer_length, 686 usb_free_coherent(urb->dev, urb->transfer_buffer_length,
687 urb->transfer_buffer, urb->transfer_dma); 687 urb->transfer_buffer, urb->transfer_dma);
688 usb_free_urb(urb); 688 usb_free_urb(urb);
689} 689}
690 690
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 5e1a253b08a0..0c2f14ff9696 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -892,7 +892,7 @@ static void acm_write_buffers_free(struct acm *acm)
892 struct usb_device *usb_dev = interface_to_usbdev(acm->control); 892 struct usb_device *usb_dev = interface_to_usbdev(acm->control);
893 893
894 for (wb = &acm->wb[0], i = 0; i < ACM_NW; i++, wb++) 894 for (wb = &acm->wb[0], i = 0; i < ACM_NW; i++, wb++)
895 usb_buffer_free(usb_dev, acm->writesize, wb->buf, wb->dmah); 895 usb_free_coherent(usb_dev, acm->writesize, wb->buf, wb->dmah);
896} 896}
897 897
898static void acm_read_buffers_free(struct acm *acm) 898static void acm_read_buffers_free(struct acm *acm)
@@ -901,8 +901,8 @@ static void acm_read_buffers_free(struct acm *acm)
901 int i, n = acm->rx_buflimit; 901 int i, n = acm->rx_buflimit;
902 902
903 for (i = 0; i < n; i++) 903 for (i = 0; i < n; i++)
904 usb_buffer_free(usb_dev, acm->readsize, 904 usb_free_coherent(usb_dev, acm->readsize,
905 acm->rb[i].base, acm->rb[i].dma); 905 acm->rb[i].base, acm->rb[i].dma);
906} 906}
907 907
908/* Little helper: write buffers allocate */ 908/* Little helper: write buffers allocate */
@@ -912,13 +912,13 @@ static int acm_write_buffers_alloc(struct acm *acm)
912 struct acm_wb *wb; 912 struct acm_wb *wb;
913 913
914 for (wb = &acm->wb[0], i = 0; i < ACM_NW; i++, wb++) { 914 for (wb = &acm->wb[0], i = 0; i < ACM_NW; i++, wb++) {
915 wb->buf = usb_buffer_alloc(acm->dev, acm->writesize, GFP_KERNEL, 915 wb->buf = usb_alloc_coherent(acm->dev, acm->writesize, GFP_KERNEL,
916 &wb->dmah); 916 &wb->dmah);
917 if (!wb->buf) { 917 if (!wb->buf) {
918 while (i != 0) { 918 while (i != 0) {
919 --i; 919 --i;
920 --wb; 920 --wb;
921 usb_buffer_free(acm->dev, acm->writesize, 921 usb_free_coherent(acm->dev, acm->writesize,
922 wb->buf, wb->dmah); 922 wb->buf, wb->dmah);
923 } 923 }
924 return -ENOMEM; 924 return -ENOMEM;
@@ -1177,7 +1177,7 @@ made_compressed_probe:
1177 tty_port_init(&acm->port); 1177 tty_port_init(&acm->port);
1178 acm->port.ops = &acm_port_ops; 1178 acm->port.ops = &acm_port_ops;
1179 1179
1180 buf = usb_buffer_alloc(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma); 1180 buf = usb_alloc_coherent(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma);
1181 if (!buf) { 1181 if (!buf) {
1182 dev_dbg(&intf->dev, "out of memory (ctrl buffer alloc)\n"); 1182 dev_dbg(&intf->dev, "out of memory (ctrl buffer alloc)\n");
1183 goto alloc_fail2; 1183 goto alloc_fail2;
@@ -1210,11 +1210,11 @@ made_compressed_probe:
1210 for (i = 0; i < num_rx_buf; i++) { 1210 for (i = 0; i < num_rx_buf; i++) {
1211 struct acm_rb *rb = &(acm->rb[i]); 1211 struct acm_rb *rb = &(acm->rb[i]);
1212 1212
1213 rb->base = usb_buffer_alloc(acm->dev, readsize, 1213 rb->base = usb_alloc_coherent(acm->dev, readsize,
1214 GFP_KERNEL, &rb->dma); 1214 GFP_KERNEL, &rb->dma);
1215 if (!rb->base) { 1215 if (!rb->base) {
1216 dev_dbg(&intf->dev, 1216 dev_dbg(&intf->dev,
1217 "out of memory (read bufs usb_buffer_alloc)\n"); 1217 "out of memory (read bufs usb_alloc_coherent)\n");
1218 goto alloc_fail7; 1218 goto alloc_fail7;
1219 } 1219 }
1220 } 1220 }
@@ -1306,7 +1306,7 @@ alloc_fail7:
1306alloc_fail5: 1306alloc_fail5:
1307 acm_write_buffers_free(acm); 1307 acm_write_buffers_free(acm);
1308alloc_fail4: 1308alloc_fail4:
1309 usb_buffer_free(usb_dev, ctrlsize, acm->ctrl_buffer, acm->ctrl_dma); 1309 usb_free_coherent(usb_dev, ctrlsize, acm->ctrl_buffer, acm->ctrl_dma);
1310alloc_fail2: 1310alloc_fail2:
1311 kfree(acm); 1311 kfree(acm);
1312alloc_fail: 1312alloc_fail:
@@ -1356,8 +1356,8 @@ static void acm_disconnect(struct usb_interface *intf)
1356 stop_data_traffic(acm); 1356 stop_data_traffic(acm);
1357 1357
1358 acm_write_buffers_free(acm); 1358 acm_write_buffers_free(acm);
1359 usb_buffer_free(usb_dev, acm->ctrlsize, acm->ctrl_buffer, 1359 usb_free_coherent(usb_dev, acm->ctrlsize, acm->ctrl_buffer,
1360 acm->ctrl_dma); 1360 acm->ctrl_dma);
1361 acm_read_buffers_free(acm); 1361 acm_read_buffers_free(acm);
1362 1362
1363 if (!acm->combined_interfaces) 1363 if (!acm->combined_interfaces)
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index 189141ca4e05..094c76b5de17 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -276,14 +276,14 @@ static void free_urbs(struct wdm_device *desc)
276 276
277static void cleanup(struct wdm_device *desc) 277static void cleanup(struct wdm_device *desc)
278{ 278{
279 usb_buffer_free(interface_to_usbdev(desc->intf), 279 usb_free_coherent(interface_to_usbdev(desc->intf),
280 desc->wMaxPacketSize, 280 desc->wMaxPacketSize,
281 desc->sbuf, 281 desc->sbuf,
282 desc->validity->transfer_dma); 282 desc->validity->transfer_dma);
283 usb_buffer_free(interface_to_usbdev(desc->intf), 283 usb_free_coherent(interface_to_usbdev(desc->intf),
284 desc->wMaxCommand, 284 desc->wMaxCommand,
285 desc->inbuf, 285 desc->inbuf,
286 desc->response->transfer_dma); 286 desc->response->transfer_dma);
287 kfree(desc->orq); 287 kfree(desc->orq);
288 kfree(desc->irq); 288 kfree(desc->irq);
289 kfree(desc->ubuf); 289 kfree(desc->ubuf);
@@ -705,17 +705,17 @@ next_desc:
705 if (!desc->ubuf) 705 if (!desc->ubuf)
706 goto err; 706 goto err;
707 707
708 desc->sbuf = usb_buffer_alloc(interface_to_usbdev(intf), 708 desc->sbuf = usb_alloc_coherent(interface_to_usbdev(intf),
709 desc->wMaxPacketSize, 709 desc->wMaxPacketSize,
710 GFP_KERNEL, 710 GFP_KERNEL,
711 &desc->validity->transfer_dma); 711 &desc->validity->transfer_dma);
712 if (!desc->sbuf) 712 if (!desc->sbuf)
713 goto err; 713 goto err;
714 714
715 desc->inbuf = usb_buffer_alloc(interface_to_usbdev(intf), 715 desc->inbuf = usb_alloc_coherent(interface_to_usbdev(intf),
716 desc->bMaxPacketSize0, 716 desc->bMaxPacketSize0,
717 GFP_KERNEL, 717 GFP_KERNEL,
718 &desc->response->transfer_dma); 718 &desc->response->transfer_dma);
719 if (!desc->inbuf) 719 if (!desc->inbuf)
720 goto err2; 720 goto err2;
721 721
@@ -742,15 +742,15 @@ out:
742 return rv; 742 return rv;
743err3: 743err3:
744 usb_set_intfdata(intf, NULL); 744 usb_set_intfdata(intf, NULL);
745 usb_buffer_free(interface_to_usbdev(desc->intf), 745 usb_free_coherent(interface_to_usbdev(desc->intf),
746 desc->bMaxPacketSize0, 746 desc->bMaxPacketSize0,
747 desc->inbuf, 747 desc->inbuf,
748 desc->response->transfer_dma); 748 desc->response->transfer_dma);
749err2: 749err2:
750 usb_buffer_free(interface_to_usbdev(desc->intf), 750 usb_free_coherent(interface_to_usbdev(desc->intf),
751 desc->wMaxPacketSize, 751 desc->wMaxPacketSize,
752 desc->sbuf, 752 desc->sbuf,
753 desc->validity->transfer_dma); 753 desc->validity->transfer_dma);
754err: 754err:
755 free_urbs(desc); 755 free_urbs(desc);
756 kfree(desc->ubuf); 756 kfree(desc->ubuf);
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index 93b5f85d7ceb..2250095db0a0 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -27,7 +27,7 @@
27 * v0.11 - add proto_bias option (Pete Zaitcev) 27 * v0.11 - add proto_bias option (Pete Zaitcev)
28 * v0.12 - add hpoj.sourceforge.net ioctls (David Paschal) 28 * v0.12 - add hpoj.sourceforge.net ioctls (David Paschal)
29 * v0.13 - alloc space for statusbuf (<status> not on stack); 29 * v0.13 - alloc space for statusbuf (<status> not on stack);
30 * use usb_buffer_alloc() for read buf & write buf; 30 * use usb_alloc_coherent() for read buf & write buf;
31 * none - Maintained in Linux kernel after v0.13 31 * none - Maintained in Linux kernel after v0.13
32 */ 32 */
33 33
diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c
index 094f91cbc578..1fa6ce3e4a23 100644
--- a/drivers/usb/misc/appledisplay.c
+++ b/drivers/usb/misc/appledisplay.c
@@ -259,7 +259,7 @@ static int appledisplay_probe(struct usb_interface *iface,
259 } 259 }
260 260
261 /* Allocate buffer for interrupt data */ 261 /* Allocate buffer for interrupt data */
262 pdata->urbdata = usb_buffer_alloc(pdata->udev, ACD_URB_BUFFER_LEN, 262 pdata->urbdata = usb_alloc_coherent(pdata->udev, ACD_URB_BUFFER_LEN,
263 GFP_KERNEL, &pdata->urb->transfer_dma); 263 GFP_KERNEL, &pdata->urb->transfer_dma);
264 if (!pdata->urbdata) { 264 if (!pdata->urbdata) {
265 retval = -ENOMEM; 265 retval = -ENOMEM;
@@ -316,7 +316,7 @@ error:
316 if (pdata->urb) { 316 if (pdata->urb) {
317 usb_kill_urb(pdata->urb); 317 usb_kill_urb(pdata->urb);
318 if (pdata->urbdata) 318 if (pdata->urbdata)
319 usb_buffer_free(pdata->udev, ACD_URB_BUFFER_LEN, 319 usb_free_coherent(pdata->udev, ACD_URB_BUFFER_LEN,
320 pdata->urbdata, pdata->urb->transfer_dma); 320 pdata->urbdata, pdata->urb->transfer_dma);
321 usb_free_urb(pdata->urb); 321 usb_free_urb(pdata->urb);
322 } 322 }
@@ -337,7 +337,7 @@ static void appledisplay_disconnect(struct usb_interface *iface)
337 usb_kill_urb(pdata->urb); 337 usb_kill_urb(pdata->urb);
338 cancel_delayed_work(&pdata->work); 338 cancel_delayed_work(&pdata->work);
339 backlight_device_unregister(pdata->bd); 339 backlight_device_unregister(pdata->bd);
340 usb_buffer_free(pdata->udev, ACD_URB_BUFFER_LEN, 340 usb_free_coherent(pdata->udev, ACD_URB_BUFFER_LEN,
341 pdata->urbdata, pdata->urb->transfer_dma); 341 pdata->urbdata, pdata->urb->transfer_dma);
342 usb_free_urb(pdata->urb); 342 usb_free_urb(pdata->urb);
343 kfree(pdata->msgdata); 343 kfree(pdata->msgdata);
diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c
index 2300a51d48b7..82e16630a78b 100644
--- a/drivers/usb/misc/ftdi-elan.c
+++ b/drivers/usb/misc/ftdi-elan.c
@@ -734,7 +734,7 @@ static void ftdi_elan_write_bulk_callback(struct urb *urb)
734 dev_err(&ftdi->udev->dev, "urb=%p write bulk status received: %" 734 dev_err(&ftdi->udev->dev, "urb=%p write bulk status received: %"
735 "d\n", urb, status); 735 "d\n", urb, status);
736 } 736 }
737 usb_buffer_free(urb->dev, urb->transfer_buffer_length, 737 usb_free_coherent(urb->dev, urb->transfer_buffer_length,
738 urb->transfer_buffer, urb->transfer_dma); 738 urb->transfer_buffer, urb->transfer_dma);
739} 739}
740 740
@@ -795,7 +795,7 @@ static int ftdi_elan_command_engine(struct usb_ftdi *ftdi)
795 total_size); 795 total_size);
796 return -ENOMEM; 796 return -ENOMEM;
797 } 797 }
798 buf = usb_buffer_alloc(ftdi->udev, total_size, GFP_KERNEL, 798 buf = usb_alloc_coherent(ftdi->udev, total_size, GFP_KERNEL,
799 &urb->transfer_dma); 799 &urb->transfer_dma);
800 if (!buf) { 800 if (!buf) {
801 dev_err(&ftdi->udev->dev, "could not get a buffer to write %d c" 801 dev_err(&ftdi->udev->dev, "could not get a buffer to write %d c"
@@ -829,7 +829,7 @@ static int ftdi_elan_command_engine(struct usb_ftdi *ftdi)
829 dev_err(&ftdi->udev->dev, "failed %d to submit urb %p to write " 829 dev_err(&ftdi->udev->dev, "failed %d to submit urb %p to write "
830 "%d commands totaling %d bytes to the Uxxx\n", retval, 830 "%d commands totaling %d bytes to the Uxxx\n", retval,
831 urb, command_size, total_size); 831 urb, command_size, total_size);
832 usb_buffer_free(ftdi->udev, total_size, buf, urb->transfer_dma); 832 usb_free_coherent(ftdi->udev, total_size, buf, urb->transfer_dma);
833 usb_free_urb(urb); 833 usb_free_urb(urb);
834 return retval; 834 return retval;
835 } 835 }
@@ -1167,7 +1167,7 @@ static ssize_t ftdi_elan_write(struct file *file,
1167 retval = -ENOMEM; 1167 retval = -ENOMEM;
1168 goto error_1; 1168 goto error_1;
1169 } 1169 }
1170 buf = usb_buffer_alloc(ftdi->udev, count, GFP_KERNEL, 1170 buf = usb_alloc_coherent(ftdi->udev, count, GFP_KERNEL,
1171 &urb->transfer_dma); 1171 &urb->transfer_dma);
1172 if (!buf) { 1172 if (!buf) {
1173 retval = -ENOMEM; 1173 retval = -ENOMEM;
@@ -1192,7 +1192,7 @@ static ssize_t ftdi_elan_write(struct file *file,
1192exit: 1192exit:
1193 return count; 1193 return count;
1194error_3: 1194error_3:
1195 usb_buffer_free(ftdi->udev, count, buf, urb->transfer_dma); 1195 usb_free_coherent(ftdi->udev, count, buf, urb->transfer_dma);
1196error_2: 1196error_2:
1197 usb_free_urb(urb); 1197 usb_free_urb(urb);
1198error_1: 1198error_1:
@@ -1968,7 +1968,7 @@ static int ftdi_elan_synchronize_flush(struct usb_ftdi *ftdi)
1968 "ence\n"); 1968 "ence\n");
1969 return -ENOMEM; 1969 return -ENOMEM;
1970 } 1970 }
1971 buf = usb_buffer_alloc(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma); 1971 buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
1972 if (!buf) { 1972 if (!buf) {
1973 dev_err(&ftdi->udev->dev, "could not get a buffer for flush seq" 1973 dev_err(&ftdi->udev->dev, "could not get a buffer for flush seq"
1974 "uence\n"); 1974 "uence\n");
@@ -1985,7 +1985,7 @@ static int ftdi_elan_synchronize_flush(struct usb_ftdi *ftdi)
1985 if (retval) { 1985 if (retval) {
1986 dev_err(&ftdi->udev->dev, "failed to submit urb containing the " 1986 dev_err(&ftdi->udev->dev, "failed to submit urb containing the "
1987 "flush sequence\n"); 1987 "flush sequence\n");
1988 usb_buffer_free(ftdi->udev, i, buf, urb->transfer_dma); 1988 usb_free_coherent(ftdi->udev, i, buf, urb->transfer_dma);
1989 usb_free_urb(urb); 1989 usb_free_urb(urb);
1990 return -ENOMEM; 1990 return -ENOMEM;
1991 } 1991 }
@@ -2011,7 +2011,7 @@ static int ftdi_elan_synchronize_reset(struct usb_ftdi *ftdi)
2011 "quence\n"); 2011 "quence\n");
2012 return -ENOMEM; 2012 return -ENOMEM;
2013 } 2013 }
2014 buf = usb_buffer_alloc(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma); 2014 buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
2015 if (!buf) { 2015 if (!buf) {
2016 dev_err(&ftdi->udev->dev, "could not get a buffer for the reset" 2016 dev_err(&ftdi->udev->dev, "could not get a buffer for the reset"
2017 " sequence\n"); 2017 " sequence\n");
@@ -2030,7 +2030,7 @@ static int ftdi_elan_synchronize_reset(struct usb_ftdi *ftdi)
2030 if (retval) { 2030 if (retval) {
2031 dev_err(&ftdi->udev->dev, "failed to submit urb containing the " 2031 dev_err(&ftdi->udev->dev, "failed to submit urb containing the "
2032 "reset sequence\n"); 2032 "reset sequence\n");
2033 usb_buffer_free(ftdi->udev, i, buf, urb->transfer_dma); 2033 usb_free_coherent(ftdi->udev, i, buf, urb->transfer_dma);
2034 usb_free_urb(urb); 2034 usb_free_urb(urb);
2035 return -ENOMEM; 2035 return -ENOMEM;
2036 } 2036 }
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index d3c852363883..7dc9d3c69984 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -239,8 +239,8 @@ static void iowarrior_write_callback(struct urb *urb)
239 __func__, status); 239 __func__, status);
240 } 240 }
241 /* free up our allocated buffer */ 241 /* free up our allocated buffer */
242 usb_buffer_free(urb->dev, urb->transfer_buffer_length, 242 usb_free_coherent(urb->dev, urb->transfer_buffer_length,
243 urb->transfer_buffer, urb->transfer_dma); 243 urb->transfer_buffer, urb->transfer_dma);
244 /* tell a waiting writer the interrupt-out-pipe is available again */ 244 /* tell a waiting writer the interrupt-out-pipe is available again */
245 atomic_dec(&dev->write_busy); 245 atomic_dec(&dev->write_busy);
246 wake_up_interruptible(&dev->write_wait); 246 wake_up_interruptible(&dev->write_wait);
@@ -421,8 +421,8 @@ static ssize_t iowarrior_write(struct file *file,
421 dbg("%s Unable to allocate urb ", __func__); 421 dbg("%s Unable to allocate urb ", __func__);
422 goto error_no_urb; 422 goto error_no_urb;
423 } 423 }
424 buf = usb_buffer_alloc(dev->udev, dev->report_size, 424 buf = usb_alloc_coherent(dev->udev, dev->report_size,
425 GFP_KERNEL, &int_out_urb->transfer_dma); 425 GFP_KERNEL, &int_out_urb->transfer_dma);
426 if (!buf) { 426 if (!buf) {
427 retval = -ENOMEM; 427 retval = -ENOMEM;
428 dbg("%s Unable to allocate buffer ", __func__); 428 dbg("%s Unable to allocate buffer ", __func__);
@@ -459,8 +459,8 @@ static ssize_t iowarrior_write(struct file *file,
459 break; 459 break;
460 } 460 }
461error: 461error:
462 usb_buffer_free(dev->udev, dev->report_size, buf, 462 usb_free_coherent(dev->udev, dev->report_size, buf,
463 int_out_urb->transfer_dma); 463 int_out_urb->transfer_dma);
464error_no_buffer: 464error_no_buffer:
465 usb_free_urb(int_out_urb); 465 usb_free_urb(int_out_urb);
466error_no_urb: 466error_no_urb:
diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c
index 90aede90553e..7828c764b323 100644
--- a/drivers/usb/misc/usblcd.c
+++ b/drivers/usb/misc/usblcd.c
@@ -205,8 +205,8 @@ static void lcd_write_bulk_callback(struct urb *urb)
205 } 205 }
206 206
207 /* free up our allocated buffer */ 207 /* free up our allocated buffer */
208 usb_buffer_free(urb->dev, urb->transfer_buffer_length, 208 usb_free_coherent(urb->dev, urb->transfer_buffer_length,
209 urb->transfer_buffer, urb->transfer_dma); 209 urb->transfer_buffer, urb->transfer_dma);
210 up(&dev->limit_sem); 210 up(&dev->limit_sem);
211} 211}
212 212
@@ -234,7 +234,7 @@ static ssize_t lcd_write(struct file *file, const char __user * user_buffer, siz
234 goto err_no_buf; 234 goto err_no_buf;
235 } 235 }
236 236
237 buf = usb_buffer_alloc(dev->udev, count, GFP_KERNEL, &urb->transfer_dma); 237 buf = usb_alloc_coherent(dev->udev, count, GFP_KERNEL, &urb->transfer_dma);
238 if (!buf) { 238 if (!buf) {
239 retval = -ENOMEM; 239 retval = -ENOMEM;
240 goto error; 240 goto error;
@@ -268,7 +268,7 @@ exit:
268error_unanchor: 268error_unanchor:
269 usb_unanchor_urb(urb); 269 usb_unanchor_urb(urb);
270error: 270error:
271 usb_buffer_free(dev->udev, count, buf, urb->transfer_dma); 271 usb_free_coherent(dev->udev, count, buf, urb->transfer_dma);
272 usb_free_urb(urb); 272 usb_free_urb(urb);
273err_no_buf: 273err_no_buf:
274 up(&dev->limit_sem); 274 up(&dev->limit_sem);
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index 9dcc82337ced..16dffe99d9f1 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -202,7 +202,7 @@ static struct urb *simple_alloc_urb (
202 urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; 202 urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
203 if (usb_pipein (pipe)) 203 if (usb_pipein (pipe))
204 urb->transfer_flags |= URB_SHORT_NOT_OK; 204 urb->transfer_flags |= URB_SHORT_NOT_OK;
205 urb->transfer_buffer = usb_buffer_alloc (udev, bytes, GFP_KERNEL, 205 urb->transfer_buffer = usb_alloc_coherent (udev, bytes, GFP_KERNEL,
206 &urb->transfer_dma); 206 &urb->transfer_dma);
207 if (!urb->transfer_buffer) { 207 if (!urb->transfer_buffer) {
208 usb_free_urb (urb); 208 usb_free_urb (urb);
@@ -272,8 +272,8 @@ static inline int simple_check_buf(struct usbtest_dev *tdev, struct urb *urb)
272 272
273static void simple_free_urb (struct urb *urb) 273static void simple_free_urb (struct urb *urb)
274{ 274{
275 usb_buffer_free (urb->dev, urb->transfer_buffer_length, 275 usb_free_coherent(urb->dev, urb->transfer_buffer_length,
276 urb->transfer_buffer, urb->transfer_dma); 276 urb->transfer_buffer, urb->transfer_dma);
277 usb_free_urb (urb); 277 usb_free_urb (urb);
278} 278}
279 279
@@ -1416,7 +1416,7 @@ static struct urb *iso_alloc_urb (
1416 1416
1417 urb->number_of_packets = packets; 1417 urb->number_of_packets = packets;
1418 urb->transfer_buffer_length = bytes; 1418 urb->transfer_buffer_length = bytes;
1419 urb->transfer_buffer = usb_buffer_alloc (udev, bytes, GFP_KERNEL, 1419 urb->transfer_buffer = usb_alloc_coherent (udev, bytes, GFP_KERNEL,
1420 &urb->transfer_dma); 1420 &urb->transfer_dma);
1421 if (!urb->transfer_buffer) { 1421 if (!urb->transfer_buffer) {
1422 usb_free_urb (urb); 1422 usb_free_urb (urb);
diff --git a/drivers/usb/storage/onetouch.c b/drivers/usb/storage/onetouch.c
index 198bb3ed95b2..1943be5a2914 100644
--- a/drivers/usb/storage/onetouch.c
+++ b/drivers/usb/storage/onetouch.c
@@ -201,8 +201,8 @@ static int onetouch_connect_input(struct us_data *ss)
201 if (!onetouch || !input_dev) 201 if (!onetouch || !input_dev)
202 goto fail1; 202 goto fail1;
203 203
204 onetouch->data = usb_buffer_alloc(udev, ONETOUCH_PKT_LEN, 204 onetouch->data = usb_alloc_coherent(udev, ONETOUCH_PKT_LEN,
205 GFP_KERNEL, &onetouch->data_dma); 205 GFP_KERNEL, &onetouch->data_dma);
206 if (!onetouch->data) 206 if (!onetouch->data)
207 goto fail1; 207 goto fail1;
208 208
@@ -264,8 +264,8 @@ static int onetouch_connect_input(struct us_data *ss)
264 return 0; 264 return 0;
265 265
266 fail3: usb_free_urb(onetouch->irq); 266 fail3: usb_free_urb(onetouch->irq);
267 fail2: usb_buffer_free(udev, ONETOUCH_PKT_LEN, 267 fail2: usb_free_coherent(udev, ONETOUCH_PKT_LEN,
268 onetouch->data, onetouch->data_dma); 268 onetouch->data, onetouch->data_dma);
269 fail1: kfree(onetouch); 269 fail1: kfree(onetouch);
270 input_free_device(input_dev); 270 input_free_device(input_dev);
271 return error; 271 return error;
@@ -279,8 +279,8 @@ static void onetouch_release_input(void *onetouch_)
279 usb_kill_urb(onetouch->irq); 279 usb_kill_urb(onetouch->irq);
280 input_unregister_device(onetouch->dev); 280 input_unregister_device(onetouch->dev);
281 usb_free_urb(onetouch->irq); 281 usb_free_urb(onetouch->irq);
282 usb_buffer_free(onetouch->udev, ONETOUCH_PKT_LEN, 282 usb_free_coherent(onetouch->udev, ONETOUCH_PKT_LEN,
283 onetouch->data, onetouch->data_dma); 283 onetouch->data, onetouch->data_dma);
284 } 284 }
285} 285}
286 286
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index c54a370c76c5..e2798ef2dd19 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -414,7 +414,7 @@ static int associate_dev(struct us_data *us, struct usb_interface *intf)
414 return -ENOMEM; 414 return -ENOMEM;
415 } 415 }
416 416
417 us->iobuf = usb_buffer_alloc(us->pusb_dev, US_IOBUF_SIZE, 417 us->iobuf = usb_alloc_coherent(us->pusb_dev, US_IOBUF_SIZE,
418 GFP_KERNEL, &us->iobuf_dma); 418 GFP_KERNEL, &us->iobuf_dma);
419 if (!us->iobuf) { 419 if (!us->iobuf) {
420 US_DEBUGP("I/O buffer allocation failed\n"); 420 US_DEBUGP("I/O buffer allocation failed\n");
@@ -758,7 +758,7 @@ static void dissociate_dev(struct us_data *us)
758 758
759 /* Free the buffers */ 759 /* Free the buffers */
760 kfree(us->cr); 760 kfree(us->cr);
761 usb_buffer_free(us->pusb_dev, US_IOBUF_SIZE, us->iobuf, us->iobuf_dma); 761 usb_free_coherent(us->pusb_dev, US_IOBUF_SIZE, us->iobuf, us->iobuf_dma);
762 762
763 /* Remove our private data from the interface */ 763 /* Remove our private data from the interface */
764 usb_set_intfdata(us->pusb_intf, NULL); 764 usb_set_intfdata(us->pusb_intf, NULL);
diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c
index 61522787f39c..d110588b56f1 100644
--- a/drivers/usb/usb-skeleton.c
+++ b/drivers/usb/usb-skeleton.c
@@ -387,8 +387,8 @@ static void skel_write_bulk_callback(struct urb *urb)
387 } 387 }
388 388
389 /* free up our allocated buffer */ 389 /* free up our allocated buffer */
390 usb_buffer_free(urb->dev, urb->transfer_buffer_length, 390 usb_free_coherent(urb->dev, urb->transfer_buffer_length,
391 urb->transfer_buffer, urb->transfer_dma); 391 urb->transfer_buffer, urb->transfer_dma);
392 up(&dev->limit_sem); 392 up(&dev->limit_sem);
393} 393}
394 394
@@ -442,8 +442,8 @@ static ssize_t skel_write(struct file *file, const char *user_buffer,
442 goto error; 442 goto error;
443 } 443 }
444 444
445 buf = usb_buffer_alloc(dev->udev, writesize, GFP_KERNEL, 445 buf = usb_alloc_coherent(dev->udev, writesize, GFP_KERNEL,
446 &urb->transfer_dma); 446 &urb->transfer_dma);
447 if (!buf) { 447 if (!buf) {
448 retval = -ENOMEM; 448 retval = -ENOMEM;
449 goto error; 449 goto error;
@@ -491,7 +491,7 @@ error_unanchor:
491 usb_unanchor_urb(urb); 491 usb_unanchor_urb(urb);
492error: 492error:
493 if (urb) { 493 if (urb) {
494 usb_buffer_free(dev->udev, writesize, buf, urb->transfer_dma); 494 usb_free_coherent(dev->udev, writesize, buf, urb->transfer_dma);
495 usb_free_urb(urb); 495 usb_free_urb(urb);
496 } 496 }
497 up(&dev->limit_sem); 497 up(&dev->limit_sem);
diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c
index 8e4eacc5bb52..748a74bd85e7 100644
--- a/drivers/watchdog/pcwd_usb.c
+++ b/drivers/watchdog/pcwd_usb.c
@@ -600,8 +600,8 @@ static inline void usb_pcwd_delete(struct usb_pcwd_private *usb_pcwd)
600{ 600{
601 usb_free_urb(usb_pcwd->intr_urb); 601 usb_free_urb(usb_pcwd->intr_urb);
602 if (usb_pcwd->intr_buffer != NULL) 602 if (usb_pcwd->intr_buffer != NULL)
603 usb_buffer_free(usb_pcwd->udev, usb_pcwd->intr_size, 603 usb_free_coherent(usb_pcwd->udev, usb_pcwd->intr_size,
604 usb_pcwd->intr_buffer, usb_pcwd->intr_dma); 604 usb_pcwd->intr_buffer, usb_pcwd->intr_dma);
605 kfree(usb_pcwd); 605 kfree(usb_pcwd);
606} 606}
607 607
@@ -671,7 +671,7 @@ static int usb_pcwd_probe(struct usb_interface *interface,
671 le16_to_cpu(endpoint->wMaxPacketSize) : 8); 671 le16_to_cpu(endpoint->wMaxPacketSize) : 8);
672 672
673 /* set up the memory buffer's */ 673 /* set up the memory buffer's */
674 usb_pcwd->intr_buffer = usb_buffer_alloc(udev, usb_pcwd->intr_size, 674 usb_pcwd->intr_buffer = usb_alloc_coherent(udev, usb_pcwd->intr_size,
675 GFP_ATOMIC, &usb_pcwd->intr_dma); 675 GFP_ATOMIC, &usb_pcwd->intr_dma);
676 if (!usb_pcwd->intr_buffer) { 676 if (!usb_pcwd->intr_buffer) {
677 printk(KERN_ERR PFX "Out of memory\n"); 677 printk(KERN_ERR PFX "Out of memory\n");
diff --git a/sound/usb/ua101.c b/sound/usb/ua101.c
index 3d458d3b9962..d700e32dee24 100644
--- a/sound/usb/ua101.c
+++ b/sound/usb/ua101.c
@@ -41,7 +41,7 @@ MODULE_SUPPORTED_DEVICE("{{Edirol,UA-101},{Edirol,UA-1000}}");
41/* 41/*
42 * This magic value optimizes memory usage efficiency for the UA-101's packet 42 * This magic value optimizes memory usage efficiency for the UA-101's packet
43 * sizes at all sample rates, taking into account the stupid cache pool sizes 43 * sizes at all sample rates, taking into account the stupid cache pool sizes
44 * that usb_buffer_alloc() uses. 44 * that usb_alloc_coherent() uses.
45 */ 45 */
46#define DEFAULT_QUEUE_LENGTH 21 46#define DEFAULT_QUEUE_LENGTH 21
47 47
@@ -1056,7 +1056,7 @@ static int alloc_stream_buffers(struct ua101 *ua, struct ua101_stream *stream)
1056 (unsigned int)MAX_QUEUE_LENGTH); 1056 (unsigned int)MAX_QUEUE_LENGTH);
1057 1057
1058 /* 1058 /*
1059 * The cache pool sizes used by usb_buffer_alloc() (128, 512, 2048) are 1059 * The cache pool sizes used by usb_alloc_coherent() (128, 512, 2048) are
1060 * quite bad when used with the packet sizes of this device (e.g. 280, 1060 * quite bad when used with the packet sizes of this device (e.g. 280,
1061 * 520, 624). Therefore, we allocate and subdivide entire pages, using 1061 * 520, 624). Therefore, we allocate and subdivide entire pages, using
1062 * a smaller buffer only for the last chunk. 1062 * a smaller buffer only for the last chunk.
@@ -1067,8 +1067,8 @@ static int alloc_stream_buffers(struct ua101 *ua, struct ua101_stream *stream)
1067 packets = min(remaining_packets, packets_per_page); 1067 packets = min(remaining_packets, packets_per_page);
1068 size = packets * stream->max_packet_bytes; 1068 size = packets * stream->max_packet_bytes;
1069 stream->buffers[i].addr = 1069 stream->buffers[i].addr =
1070 usb_buffer_alloc(ua->dev, size, GFP_KERNEL, 1070 usb_alloc_coherent(ua->dev, size, GFP_KERNEL,
1071 &stream->buffers[i].dma); 1071 &stream->buffers[i].dma);
1072 if (!stream->buffers[i].addr) 1072 if (!stream->buffers[i].addr)
1073 return -ENOMEM; 1073 return -ENOMEM;
1074 stream->buffers[i].size = size; 1074 stream->buffers[i].size = size;
@@ -1088,10 +1088,10 @@ static void free_stream_buffers(struct ua101 *ua, struct ua101_stream *stream)
1088 unsigned int i; 1088 unsigned int i;
1089 1089
1090 for (i = 0; i < ARRAY_SIZE(stream->buffers); ++i) 1090 for (i = 0; i < ARRAY_SIZE(stream->buffers); ++i)
1091 usb_buffer_free(ua->dev, 1091 usb_free_coherent(ua->dev,
1092 stream->buffers[i].size, 1092 stream->buffers[i].size,
1093 stream->buffers[i].addr, 1093 stream->buffers[i].addr,
1094 stream->buffers[i].dma); 1094 stream->buffers[i].dma);
1095} 1095}
1096 1096
1097static int alloc_stream_urbs(struct ua101 *ua, struct ua101_stream *stream, 1097static int alloc_stream_urbs(struct ua101 *ua, struct ua101_stream *stream,
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index 11b0826b8fe6..9d2274ce01d5 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -985,9 +985,9 @@ static void release_urb_ctx(struct snd_urb_ctx *u)
985{ 985{
986 if (u->urb) { 986 if (u->urb) {
987 if (u->buffer_size) 987 if (u->buffer_size)
988 usb_buffer_free(u->subs->dev, u->buffer_size, 988 usb_free_coherent(u->subs->dev, u->buffer_size,
989 u->urb->transfer_buffer, 989 u->urb->transfer_buffer,
990 u->urb->transfer_dma); 990 u->urb->transfer_dma);
991 usb_free_urb(u->urb); 991 usb_free_urb(u->urb);
992 u->urb = NULL; 992 u->urb = NULL;
993 } 993 }
@@ -1008,8 +1008,8 @@ static void release_substream_urbs(struct snd_usb_substream *subs, int force)
1008 release_urb_ctx(&subs->dataurb[i]); 1008 release_urb_ctx(&subs->dataurb[i]);
1009 for (i = 0; i < SYNC_URBS; i++) 1009 for (i = 0; i < SYNC_URBS; i++)
1010 release_urb_ctx(&subs->syncurb[i]); 1010 release_urb_ctx(&subs->syncurb[i]);
1011 usb_buffer_free(subs->dev, SYNC_URBS * 4, 1011 usb_free_coherent(subs->dev, SYNC_URBS * 4,
1012 subs->syncbuf, subs->sync_dma); 1012 subs->syncbuf, subs->sync_dma);
1013 subs->syncbuf = NULL; 1013 subs->syncbuf = NULL;
1014 subs->nurbs = 0; 1014 subs->nurbs = 0;
1015} 1015}
@@ -1113,8 +1113,8 @@ static int init_substream_urbs(struct snd_usb_substream *subs, unsigned int peri
1113 if (!u->urb) 1113 if (!u->urb)
1114 goto out_of_memory; 1114 goto out_of_memory;
1115 u->urb->transfer_buffer = 1115 u->urb->transfer_buffer =
1116 usb_buffer_alloc(subs->dev, u->buffer_size, GFP_KERNEL, 1116 usb_alloc_coherent(subs->dev, u->buffer_size, GFP_KERNEL,
1117 &u->urb->transfer_dma); 1117 &u->urb->transfer_dma);
1118 if (!u->urb->transfer_buffer) 1118 if (!u->urb->transfer_buffer)
1119 goto out_of_memory; 1119 goto out_of_memory;
1120 u->urb->pipe = subs->datapipe; 1120 u->urb->pipe = subs->datapipe;
@@ -1126,8 +1126,8 @@ static int init_substream_urbs(struct snd_usb_substream *subs, unsigned int peri
1126 1126
1127 if (subs->syncpipe) { 1127 if (subs->syncpipe) {
1128 /* allocate and initialize sync urbs */ 1128 /* allocate and initialize sync urbs */
1129 subs->syncbuf = usb_buffer_alloc(subs->dev, SYNC_URBS * 4, 1129 subs->syncbuf = usb_alloc_coherent(subs->dev, SYNC_URBS * 4,
1130 GFP_KERNEL, &subs->sync_dma); 1130 GFP_KERNEL, &subs->sync_dma);
1131 if (!subs->syncbuf) 1131 if (!subs->syncbuf)
1132 goto out_of_memory; 1132 goto out_of_memory;
1133 for (i = 0; i < SYNC_URBS; i++) { 1133 for (i = 0; i < SYNC_URBS; i++) {
diff --git a/sound/usb/usbmidi.c b/sound/usb/usbmidi.c
index 9e28b20cb2ce..61b2d8fd0331 100644
--- a/sound/usb/usbmidi.c
+++ b/sound/usb/usbmidi.c
@@ -1047,8 +1047,8 @@ static struct snd_rawmidi_ops snd_usbmidi_input_ops = {
1047static void free_urb_and_buffer(struct snd_usb_midi *umidi, struct urb *urb, 1047static void free_urb_and_buffer(struct snd_usb_midi *umidi, struct urb *urb,
1048 unsigned int buffer_length) 1048 unsigned int buffer_length)
1049{ 1049{
1050 usb_buffer_free(umidi->dev, buffer_length, 1050 usb_free_coherent(umidi->dev, buffer_length,
1051 urb->transfer_buffer, urb->transfer_dma); 1051 urb->transfer_buffer, urb->transfer_dma);
1052 usb_free_urb(urb); 1052 usb_free_urb(urb);
1053} 1053}
1054 1054
@@ -1099,8 +1099,8 @@ static int snd_usbmidi_in_endpoint_create(struct snd_usb_midi* umidi,
1099 pipe = usb_rcvbulkpipe(umidi->dev, ep_info->in_ep); 1099 pipe = usb_rcvbulkpipe(umidi->dev, ep_info->in_ep);
1100 length = usb_maxpacket(umidi->dev, pipe, 0); 1100 length = usb_maxpacket(umidi->dev, pipe, 0);
1101 for (i = 0; i < INPUT_URBS; ++i) { 1101 for (i = 0; i < INPUT_URBS; ++i) {
1102 buffer = usb_buffer_alloc(umidi->dev, length, GFP_KERNEL, 1102 buffer = usb_alloc_coherent(umidi->dev, length, GFP_KERNEL,
1103 &ep->urbs[i]->transfer_dma); 1103 &ep->urbs[i]->transfer_dma);
1104 if (!buffer) { 1104 if (!buffer) {
1105 snd_usbmidi_in_endpoint_delete(ep); 1105 snd_usbmidi_in_endpoint_delete(ep);
1106 return -ENOMEM; 1106 return -ENOMEM;
@@ -1190,9 +1190,9 @@ static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi* umidi,
1190 break; 1190 break;
1191 } 1191 }
1192 for (i = 0; i < OUTPUT_URBS; ++i) { 1192 for (i = 0; i < OUTPUT_URBS; ++i) {
1193 buffer = usb_buffer_alloc(umidi->dev, 1193 buffer = usb_alloc_coherent(umidi->dev,
1194 ep->max_transfer, GFP_KERNEL, 1194 ep->max_transfer, GFP_KERNEL,
1195 &ep->urbs[i].urb->transfer_dma); 1195 &ep->urbs[i].urb->transfer_dma);
1196 if (!buffer) { 1196 if (!buffer) {
1197 snd_usbmidi_out_endpoint_delete(ep); 1197 snd_usbmidi_out_endpoint_delete(ep);
1198 return -ENOMEM; 1198 return -ENOMEM;