[svn-commits] tzafrir: linux/trunk r8762 - /linux/trunk/drivers/dahdi/xpp/xpp_usb.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jun 8 14:46:19 CDT 2010


Author: tzafrir
Date: Tue Jun  8 14:46:15 2010
New Revision: 8762

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8762
Log:
Use usb_{alloc,free}_coherent instead of usb_buffer_{alloc,free}.

usb_buffer_alloc has been replaced with usb_alloc_coherent , and likewise
usb_buffer_free has been replaced with usb_free_coherent. in kernels 2.6.34
the older names are proxies for the new ones, and in 2.6.35 the older names are gone.

This patch defines the new names for the old ones, for older kernel versions.

(closes issue #17383)
Reported by: Chainsaw

Modified:
    linux/trunk/drivers/dahdi/xpp/xpp_usb.c

Modified: linux/trunk/drivers/dahdi/xpp/xpp_usb.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/xpp_usb.c?view=diff&rev=8762&r1=8761&r2=8762
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/xpp_usb.c (original)
+++ linux/trunk/drivers/dahdi/xpp/xpp_usb.c Tue Jun  8 14:46:15 2010
@@ -78,6 +78,14 @@
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
 #  warning "This module is tested only with 2.6 kernels"
 #endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
+#  define usb_alloc_coherent(dev, size, mem_flags, dma) \
+	usb_buffer_alloc(dev, size, mem_flags, dma)
+#  define usb_free_coherent(dev, size, addr, dma) \
+	usb_buffer_free(dev, size, addr, dma)
+#endif
+
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
 #  undef USB_FIELDS_MISSING
 #else
@@ -308,7 +316,7 @@
 		return NULL;
 	}
 	usb_init_urb(&uframe->urb);
-	p = usb_buffer_alloc(xusb->udev, size, gfp_flags, &uframe->urb.transfer_dma);
+	p = usb_alloc_coherent(xusb->udev, size, gfp_flags, &uframe->urb.transfer_dma);
 	if(!p) {
 		if((rate_limit++ % 1003) == 0)
 			XUSB_ERR(xusb, "buffer allocation failed (%d)\n", rate_limit);
@@ -330,7 +338,7 @@
 
 	BUG_ON(xbus->transport.priv != uframe->xusb);
 	//XUSB_INFO(uframe->xusb, "frame_free\n");
-	usb_buffer_free(urb->dev, uframe->transfer_buffer_length,
+	usb_free_coherent(urb->dev, uframe->transfer_buffer_length,
 			urb->transfer_buffer,
 			urb->transfer_dma);
 	memset(uframe, 0, sizeof(*uframe));




More information about the svn-commits mailing list