diff options
author | Daniel Mack <daniel@caiaq.de> | 2010-04-12 07:17:25 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-20 16:21:38 -0400 |
commit | 997ea58eb92f9970b8af7aae48800d0ef43b9423 (patch) | |
tree | 65e021973e5a48ad7290d5be1f441940566468ad /drivers/net/can/usb/ems_usb.c | |
parent | 48679c6d772b1459a2945729e3a1256ac78fcabf (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/net/can/usb/ems_usb.c')
-rw-r--r-- | drivers/net/can/usb/ems_usb.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c index d800b598ae3d..25a5c7eea948 100644 --- a/drivers/net/can/usb/ems_usb.c +++ b/drivers/net/can/usb/ems_usb.c | |||
@@ -516,8 +516,8 @@ static void ems_usb_write_bulk_callback(struct urb *urb) | |||
516 | netdev = dev->netdev; | 516 | netdev = dev->netdev; |
517 | 517 | ||
518 | /* free up our allocated buffer */ | 518 | /* free up our allocated buffer */ |
519 | usb_buffer_free(urb->dev, urb->transfer_buffer_length, | 519 | usb_free_coherent(urb->dev, urb->transfer_buffer_length, |
520 | urb->transfer_buffer, urb->transfer_dma); | 520 | urb->transfer_buffer, urb->transfer_dma); |
521 | 521 | ||
522 | atomic_dec(&dev->active_tx_urbs); | 522 | atomic_dec(&dev->active_tx_urbs); |
523 | 523 | ||
@@ -614,8 +614,8 @@ static int ems_usb_start(struct ems_usb *dev) | |||
614 | return -ENOMEM; | 614 | return -ENOMEM; |
615 | } | 615 | } |
616 | 616 | ||
617 | buf = usb_buffer_alloc(dev->udev, RX_BUFFER_SIZE, GFP_KERNEL, | 617 | buf = usb_alloc_coherent(dev->udev, RX_BUFFER_SIZE, GFP_KERNEL, |
618 | &urb->transfer_dma); | 618 | &urb->transfer_dma); |
619 | if (!buf) { | 619 | if (!buf) { |
620 | dev_err(netdev->dev.parent, | 620 | dev_err(netdev->dev.parent, |
621 | "No memory left for USB buffer\n"); | 621 | "No memory left for USB buffer\n"); |
@@ -635,8 +635,8 @@ static int ems_usb_start(struct ems_usb *dev) | |||
635 | netif_device_detach(dev->netdev); | 635 | netif_device_detach(dev->netdev); |
636 | 636 | ||
637 | usb_unanchor_urb(urb); | 637 | usb_unanchor_urb(urb); |
638 | usb_buffer_free(dev->udev, RX_BUFFER_SIZE, buf, | 638 | usb_free_coherent(dev->udev, RX_BUFFER_SIZE, buf, |
639 | urb->transfer_dma); | 639 | urb->transfer_dma); |
640 | break; | 640 | break; |
641 | } | 641 | } |
642 | 642 | ||
@@ -777,7 +777,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne | |||
777 | goto nomem; | 777 | goto nomem; |
778 | } | 778 | } |
779 | 779 | ||
780 | buf = usb_buffer_alloc(dev->udev, size, GFP_ATOMIC, &urb->transfer_dma); | 780 | buf = usb_alloc_coherent(dev->udev, size, GFP_ATOMIC, &urb->transfer_dma); |
781 | if (!buf) { | 781 | if (!buf) { |
782 | dev_err(netdev->dev.parent, "No memory left for USB buffer\n"); | 782 | dev_err(netdev->dev.parent, "No memory left for USB buffer\n"); |
783 | usb_free_urb(urb); | 783 | usb_free_urb(urb); |
@@ -820,7 +820,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne | |||
820 | */ | 820 | */ |
821 | if (!context) { | 821 | if (!context) { |
822 | usb_unanchor_urb(urb); | 822 | usb_unanchor_urb(urb); |
823 | usb_buffer_free(dev->udev, size, buf, urb->transfer_dma); | 823 | usb_free_coherent(dev->udev, size, buf, urb->transfer_dma); |
824 | 824 | ||
825 | dev_warn(netdev->dev.parent, "couldn't find free context\n"); | 825 | dev_warn(netdev->dev.parent, "couldn't find free context\n"); |
826 | 826 | ||
@@ -845,7 +845,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne | |||
845 | can_free_echo_skb(netdev, context->echo_index); | 845 | can_free_echo_skb(netdev, context->echo_index); |
846 | 846 | ||
847 | usb_unanchor_urb(urb); | 847 | usb_unanchor_urb(urb); |
848 | usb_buffer_free(dev->udev, size, buf, urb->transfer_dma); | 848 | usb_free_coherent(dev->udev, size, buf, urb->transfer_dma); |
849 | dev_kfree_skb(skb); | 849 | dev_kfree_skb(skb); |
850 | 850 | ||
851 | atomic_dec(&dev->active_tx_urbs); | 851 | atomic_dec(&dev->active_tx_urbs); |