aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/usb-skeleton.c
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2010-04-12 07:17:25 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-20 16:21:38 -0400
commit997ea58eb92f9970b8af7aae48800d0ef43b9423 (patch)
tree65e021973e5a48ad7290d5be1f441940566468ad /drivers/usb/usb-skeleton.c
parent48679c6d772b1459a2945729e3a1256ac78fcabf (diff)
USB: rename usb_buffer_alloc() and usb_buffer_free() users
For more clearance what the functions actually do, usb_buffer_alloc() is renamed to usb_alloc_coherent() usb_buffer_free() is renamed to usb_free_coherent() They should only be used in code which really needs DMA coherency. All call sites have been changed accordingly, except for staging drivers. Signed-off-by: Daniel Mack <daniel@caiaq.de> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Pedro Ribeiro <pedrib@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/usb-skeleton.c')
-rw-r--r--drivers/usb/usb-skeleton.c10
1 files changed, 5 insertions, 5 deletions
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);