diff options
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 22 | ||||
-rw-r--r-- | drivers/usb/class/cdc-wdm.c | 38 | ||||
-rw-r--r-- | drivers/usb/class/usblp.c | 2 | ||||
-rw-r--r-- | drivers/usb/misc/appledisplay.c | 6 | ||||
-rw-r--r-- | drivers/usb/misc/ftdi-elan.c | 18 | ||||
-rw-r--r-- | drivers/usb/misc/iowarrior.c | 12 | ||||
-rw-r--r-- | drivers/usb/misc/usblcd.c | 8 | ||||
-rw-r--r-- | drivers/usb/misc/usbtest.c | 8 | ||||
-rw-r--r-- | drivers/usb/storage/onetouch.c | 12 | ||||
-rw-r--r-- | drivers/usb/storage/usb.c | 4 | ||||
-rw-r--r-- | drivers/usb/usb-skeleton.c | 10 |
11 files changed, 70 insertions, 70 deletions
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 | ||
898 | static void acm_read_buffers_free(struct acm *acm) | 898 | static 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: | |||
1306 | alloc_fail5: | 1306 | alloc_fail5: |
1307 | acm_write_buffers_free(acm); | 1307 | acm_write_buffers_free(acm); |
1308 | alloc_fail4: | 1308 | alloc_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); |
1310 | alloc_fail2: | 1310 | alloc_fail2: |
1311 | kfree(acm); | 1311 | kfree(acm); |
1312 | alloc_fail: | 1312 | alloc_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 | ||
277 | static void cleanup(struct wdm_device *desc) | 277 | static 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; |
743 | err3: | 743 | err3: |
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); |
749 | err2: | 749 | err2: |
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); |
754 | err: | 754 | err: |
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, | |||
1192 | exit: | 1192 | exit: |
1193 | return count; | 1193 | return count; |
1194 | error_3: | 1194 | error_3: |
1195 | usb_buffer_free(ftdi->udev, count, buf, urb->transfer_dma); | 1195 | usb_free_coherent(ftdi->udev, count, buf, urb->transfer_dma); |
1196 | error_2: | 1196 | error_2: |
1197 | usb_free_urb(urb); | 1197 | usb_free_urb(urb); |
1198 | error_1: | 1198 | error_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 | } |
461 | error: | 461 | error: |
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); |
464 | error_no_buffer: | 464 | error_no_buffer: |
465 | usb_free_urb(int_out_urb); | 465 | usb_free_urb(int_out_urb); |
466 | error_no_urb: | 466 | error_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: | |||
268 | error_unanchor: | 268 | error_unanchor: |
269 | usb_unanchor_urb(urb); | 269 | usb_unanchor_urb(urb); |
270 | error: | 270 | error: |
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); |
273 | err_no_buf: | 273 | err_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 | ||
273 | static void simple_free_urb (struct urb *urb) | 273 | static 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); |
492 | error: | 492 | error: |
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); |