aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/usbtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/misc/usbtest.c')
-rw-r--r--drivers/usb/misc/usbtest.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index a21cce6f7403..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
@@ -977,15 +977,13 @@ test_ctrl_queue (struct usbtest_dev *dev, struct usbtest_param *param)
977 if (!u) 977 if (!u)
978 goto cleanup; 978 goto cleanup;
979 979
980 reqp = usb_buffer_alloc (udev, sizeof *reqp, GFP_KERNEL, 980 reqp = kmalloc(sizeof *reqp, GFP_KERNEL);
981 &u->setup_dma);
982 if (!reqp) 981 if (!reqp)
983 goto cleanup; 982 goto cleanup;
984 reqp->setup = req; 983 reqp->setup = req;
985 reqp->number = i % NUM_SUBCASES; 984 reqp->number = i % NUM_SUBCASES;
986 reqp->expected = expected; 985 reqp->expected = expected;
987 u->setup_packet = (char *) &reqp->setup; 986 u->setup_packet = (char *) &reqp->setup;
988 u->transfer_flags |= URB_NO_SETUP_DMA_MAP;
989 987
990 u->context = &context; 988 u->context = &context;
991 u->complete = ctrl_complete; 989 u->complete = ctrl_complete;
@@ -1017,10 +1015,7 @@ cleanup:
1017 if (!urb [i]) 1015 if (!urb [i])
1018 continue; 1016 continue;
1019 urb [i]->dev = udev; 1017 urb [i]->dev = udev;
1020 if (urb [i]->setup_packet) 1018 kfree(urb[i]->setup_packet);
1021 usb_buffer_free (udev, sizeof (struct usb_ctrlrequest),
1022 urb [i]->setup_packet,
1023 urb [i]->setup_dma);
1024 simple_free_urb (urb [i]); 1019 simple_free_urb (urb [i]);
1025 } 1020 }
1026 kfree (urb); 1021 kfree (urb);
@@ -1421,7 +1416,7 @@ static struct urb *iso_alloc_urb (
1421 1416
1422 urb->number_of_packets = packets; 1417 urb->number_of_packets = packets;
1423 urb->transfer_buffer_length = bytes; 1418 urb->transfer_buffer_length = bytes;
1424 urb->transfer_buffer = usb_buffer_alloc (udev, bytes, GFP_KERNEL, 1419 urb->transfer_buffer = usb_alloc_coherent (udev, bytes, GFP_KERNEL,
1425 &urb->transfer_dma); 1420 &urb->transfer_dma);
1426 if (!urb->transfer_buffer) { 1421 if (!urb->transfer_buffer) {
1427 usb_free_urb (urb); 1422 usb_free_urb (urb);