aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc/cm109.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-21 00:26:12 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-21 00:26:12 -0400
commit7a9b149212f3716c598afe973b6261fd58453b7a (patch)
tree477716d84c71da124448b72278e98da28aadbd3d /drivers/input/misc/cm109.c
parent3d62e3fdce8ef265a3706c52ae1ca6ab84e30f0e (diff)
parente26bcf37234c67624f62d9fc95f922b8dbda1363 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (229 commits) USB: remove unused usb_buffer_alloc and usb_buffer_free macros usb: musb: update gfp/slab.h includes USB: ftdi_sio: fix legacy SIO-device header USB: kl5usb105: reimplement using generic framework USB: kl5usb105: minor clean ups USB: kl5usb105: fix memory leak USB: io_ti: use kfifo to implement write buffering USB: io_ti: remove unsused private counter USB: ti_usb: use kfifo to implement write buffering USB: ir-usb: fix incorrect write-buffer length USB: aircable: fix incorrect write-buffer length USB: safe_serial: straighten out read processing USB: safe_serial: reimplement read using generic framework USB: safe_serial: reimplement write using generic framework usb-storage: always print quirks USB: usb-storage: trivial debug improvements USB: oti6858: use port write fifo USB: oti6858: use kfifo to implement write buffering USB: cypress_m8: use kfifo to implement write buffering USB: cypress_m8: remove unused drain define ... Fix up conflicts (due to usb_buffer_alloc/free renaming) in drivers/input/tablet/acecad.c drivers/input/tablet/kbtab.c drivers/input/tablet/wacom_sys.c drivers/media/video/gspca/gspca.c sound/usb/usbaudio.c
Diffstat (limited to 'drivers/input/misc/cm109.c')
-rw-r--r--drivers/input/misc/cm109.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c
index 86457feccfc4..2b0eba6619bd 100644
--- a/drivers/input/misc/cm109.c
+++ b/drivers/input/misc/cm109.c
@@ -102,7 +102,6 @@ struct cm109_dev {
102 struct cm109_ctl_packet *ctl_data; 102 struct cm109_ctl_packet *ctl_data;
103 dma_addr_t ctl_dma; 103 dma_addr_t ctl_dma;
104 struct usb_ctrlrequest *ctl_req; 104 struct usb_ctrlrequest *ctl_req;
105 dma_addr_t ctl_req_dma;
106 struct urb *urb_ctl; 105 struct urb *urb_ctl;
107 /* 106 /*
108 * The 3 bitfields below are protected by ctl_submit_lock. 107 * The 3 bitfields below are protected by ctl_submit_lock.
@@ -629,15 +628,13 @@ static const struct usb_device_id cm109_usb_table[] = {
629 628
630static void cm109_usb_cleanup(struct cm109_dev *dev) 629static void cm109_usb_cleanup(struct cm109_dev *dev)
631{ 630{
632 if (dev->ctl_req) 631 kfree(dev->ctl_req);
633 usb_buffer_free(dev->udev, sizeof(*(dev->ctl_req)),
634 dev->ctl_req, dev->ctl_req_dma);
635 if (dev->ctl_data) 632 if (dev->ctl_data)
636 usb_buffer_free(dev->udev, USB_PKT_LEN, 633 usb_free_coherent(dev->udev, USB_PKT_LEN,
637 dev->ctl_data, dev->ctl_dma); 634 dev->ctl_data, dev->ctl_dma);
638 if (dev->irq_data) 635 if (dev->irq_data)
639 usb_buffer_free(dev->udev, USB_PKT_LEN, 636 usb_free_coherent(dev->udev, USB_PKT_LEN,
640 dev->irq_data, dev->irq_dma); 637 dev->irq_data, dev->irq_dma);
641 638
642 usb_free_urb(dev->urb_irq); /* parameter validation in core/urb */ 639 usb_free_urb(dev->urb_irq); /* parameter validation in core/urb */
643 usb_free_urb(dev->urb_ctl); /* parameter validation in core/urb */ 640 usb_free_urb(dev->urb_ctl); /* parameter validation in core/urb */
@@ -686,18 +683,17 @@ static int cm109_usb_probe(struct usb_interface *intf,
686 goto err_out; 683 goto err_out;
687 684
688 /* allocate usb buffers */ 685 /* allocate usb buffers */
689 dev->irq_data = usb_buffer_alloc(udev, USB_PKT_LEN, 686 dev->irq_data = usb_alloc_coherent(udev, USB_PKT_LEN,
690 GFP_KERNEL, &dev->irq_dma); 687 GFP_KERNEL, &dev->irq_dma);
691 if (!dev->irq_data) 688 if (!dev->irq_data)
692 goto err_out; 689 goto err_out;
693 690
694 dev->ctl_data = usb_buffer_alloc(udev, USB_PKT_LEN, 691 dev->ctl_data = usb_alloc_coherent(udev, USB_PKT_LEN,
695 GFP_KERNEL, &dev->ctl_dma); 692 GFP_KERNEL, &dev->ctl_dma);
696 if (!dev->ctl_data) 693 if (!dev->ctl_data)
697 goto err_out; 694 goto err_out;
698 695
699 dev->ctl_req = usb_buffer_alloc(udev, sizeof(*(dev->ctl_req)), 696 dev->ctl_req = kmalloc(sizeof(*(dev->ctl_req)), GFP_KERNEL);
700 GFP_KERNEL, &dev->ctl_req_dma);
701 if (!dev->ctl_req) 697 if (!dev->ctl_req)
702 goto err_out; 698 goto err_out;
703 699
@@ -735,10 +731,8 @@ static int cm109_usb_probe(struct usb_interface *intf,
735 usb_fill_control_urb(dev->urb_ctl, udev, usb_sndctrlpipe(udev, 0), 731 usb_fill_control_urb(dev->urb_ctl, udev, usb_sndctrlpipe(udev, 0),
736 (void *)dev->ctl_req, dev->ctl_data, USB_PKT_LEN, 732 (void *)dev->ctl_req, dev->ctl_data, USB_PKT_LEN,
737 cm109_urb_ctl_callback, dev); 733 cm109_urb_ctl_callback, dev);
738 dev->urb_ctl->setup_dma = dev->ctl_req_dma;
739 dev->urb_ctl->transfer_dma = dev->ctl_dma; 734 dev->urb_ctl->transfer_dma = dev->ctl_dma;
740 dev->urb_ctl->transfer_flags |= URB_NO_SETUP_DMA_MAP | 735 dev->urb_ctl->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
741 URB_NO_TRANSFER_DMA_MAP;
742 dev->urb_ctl->dev = udev; 736 dev->urb_ctl->dev = udev;
743 737
744 /* find out the physical bus location */ 738 /* find out the physical bus location */