aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/gspca.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/media/video/gspca/gspca.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/media/video/gspca/gspca.c')
-rw-r--r--drivers/media/video/gspca/gspca.c30
1 files changed, 15 insertions, 15 deletions
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;