diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2010-06-08 19:46:15 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2010-06-08 19:46:15 +0000 |
commit | 0212618ef11a32ebfd382d3c8e36b6e7a231bfe9 (patch) | |
tree | 9b268b03af9bc9587549ce8ae7d2d7f15b414d74 | |
parent | 6fefa328803ce3c8f764c5a8378916e46582917b (diff) |
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
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8762 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r-- | drivers/dahdi/xpp/xpp_usb.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/dahdi/xpp/xpp_usb.c b/drivers/dahdi/xpp/xpp_usb.c index d69c99d..15507ee 100644 --- a/drivers/dahdi/xpp/xpp_usb.c +++ b/drivers/dahdi/xpp/xpp_usb.c @@ -78,6 +78,14 @@ static DEF_PARM(uint, drop_pcm_after, 6, 0644, "Number of consecutive tx_sluggis #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 @@ static xframe_t *alloc_xframe(xbus_t *xbus, gfp_t gfp_flags) 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 @@ static void free_xframe(xbus_t *xbus, xframe_t *xframe) 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)); |