diff options
Diffstat (limited to 'drivers/input/misc')
-rw-r--r-- | drivers/input/misc/ati_remote.c | 12 | ||||
-rw-r--r-- | drivers/input/misc/ati_remote2.c | 4 | ||||
-rw-r--r-- | drivers/input/misc/cm109.c | 28 | ||||
-rw-r--r-- | drivers/input/misc/keyspan_remote.c | 6 | ||||
-rw-r--r-- | drivers/input/misc/powermate.c | 17 | ||||
-rw-r--r-- | drivers/input/misc/yealink.c | 25 |
6 files changed, 37 insertions, 55 deletions
diff --git a/drivers/input/misc/ati_remote.c b/drivers/input/misc/ati_remote.c index e8bbc619f6df..bce57129afba 100644 --- a/drivers/input/misc/ati_remote.c +++ b/drivers/input/misc/ati_remote.c | |||
@@ -624,13 +624,13 @@ static void ati_remote_irq_in(struct urb *urb) | |||
624 | static int ati_remote_alloc_buffers(struct usb_device *udev, | 624 | static int ati_remote_alloc_buffers(struct usb_device *udev, |
625 | struct ati_remote *ati_remote) | 625 | struct ati_remote *ati_remote) |
626 | { | 626 | { |
627 | ati_remote->inbuf = usb_buffer_alloc(udev, DATA_BUFSIZE, GFP_ATOMIC, | 627 | ati_remote->inbuf = usb_alloc_coherent(udev, DATA_BUFSIZE, GFP_ATOMIC, |
628 | &ati_remote->inbuf_dma); | 628 | &ati_remote->inbuf_dma); |
629 | if (!ati_remote->inbuf) | 629 | if (!ati_remote->inbuf) |
630 | return -1; | 630 | return -1; |
631 | 631 | ||
632 | ati_remote->outbuf = usb_buffer_alloc(udev, DATA_BUFSIZE, GFP_ATOMIC, | 632 | ati_remote->outbuf = usb_alloc_coherent(udev, DATA_BUFSIZE, GFP_ATOMIC, |
633 | &ati_remote->outbuf_dma); | 633 | &ati_remote->outbuf_dma); |
634 | if (!ati_remote->outbuf) | 634 | if (!ati_remote->outbuf) |
635 | return -1; | 635 | return -1; |
636 | 636 | ||
@@ -653,10 +653,10 @@ static void ati_remote_free_buffers(struct ati_remote *ati_remote) | |||
653 | usb_free_urb(ati_remote->irq_urb); | 653 | usb_free_urb(ati_remote->irq_urb); |
654 | usb_free_urb(ati_remote->out_urb); | 654 | usb_free_urb(ati_remote->out_urb); |
655 | 655 | ||
656 | usb_buffer_free(ati_remote->udev, DATA_BUFSIZE, | 656 | usb_free_coherent(ati_remote->udev, DATA_BUFSIZE, |
657 | ati_remote->inbuf, ati_remote->inbuf_dma); | 657 | ati_remote->inbuf, ati_remote->inbuf_dma); |
658 | 658 | ||
659 | usb_buffer_free(ati_remote->udev, DATA_BUFSIZE, | 659 | usb_free_coherent(ati_remote->udev, DATA_BUFSIZE, |
660 | ati_remote->outbuf, ati_remote->outbuf_dma); | 660 | ati_remote->outbuf, ati_remote->outbuf_dma); |
661 | } | 661 | } |
662 | 662 | ||
diff --git a/drivers/input/misc/ati_remote2.c b/drivers/input/misc/ati_remote2.c index 2124b99378bb..e148749b5851 100644 --- a/drivers/input/misc/ati_remote2.c +++ b/drivers/input/misc/ati_remote2.c | |||
@@ -589,7 +589,7 @@ static int ati_remote2_urb_init(struct ati_remote2 *ar2) | |||
589 | int i, pipe, maxp; | 589 | int i, pipe, maxp; |
590 | 590 | ||
591 | for (i = 0; i < 2; i++) { | 591 | for (i = 0; i < 2; i++) { |
592 | ar2->buf[i] = usb_buffer_alloc(udev, 4, GFP_KERNEL, &ar2->buf_dma[i]); | 592 | ar2->buf[i] = usb_alloc_coherent(udev, 4, GFP_KERNEL, &ar2->buf_dma[i]); |
593 | if (!ar2->buf[i]) | 593 | if (!ar2->buf[i]) |
594 | return -ENOMEM; | 594 | return -ENOMEM; |
595 | 595 | ||
@@ -617,7 +617,7 @@ static void ati_remote2_urb_cleanup(struct ati_remote2 *ar2) | |||
617 | 617 | ||
618 | for (i = 0; i < 2; i++) { | 618 | for (i = 0; i < 2; i++) { |
619 | usb_free_urb(ar2->urb[i]); | 619 | usb_free_urb(ar2->urb[i]); |
620 | usb_buffer_free(ar2->udev, 4, ar2->buf[i], ar2->buf_dma[i]); | 620 | usb_free_coherent(ar2->udev, 4, ar2->buf[i], ar2->buf_dma[i]); |
621 | } | 621 | } |
622 | } | 622 | } |
623 | 623 | ||
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 | ||
630 | static void cm109_usb_cleanup(struct cm109_dev *dev) | 629 | static 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 */ |
diff --git a/drivers/input/misc/keyspan_remote.c b/drivers/input/misc/keyspan_remote.c index 86afdd1fdf9d..a93c525475c6 100644 --- a/drivers/input/misc/keyspan_remote.c +++ b/drivers/input/misc/keyspan_remote.c | |||
@@ -464,7 +464,7 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic | |||
464 | remote->in_endpoint = endpoint; | 464 | remote->in_endpoint = endpoint; |
465 | remote->toggle = -1; /* Set to -1 so we will always not match the toggle from the first remote message. */ | 465 | remote->toggle = -1; /* Set to -1 so we will always not match the toggle from the first remote message. */ |
466 | 466 | ||
467 | remote->in_buffer = usb_buffer_alloc(udev, RECV_SIZE, GFP_ATOMIC, &remote->in_dma); | 467 | remote->in_buffer = usb_alloc_coherent(udev, RECV_SIZE, GFP_ATOMIC, &remote->in_dma); |
468 | if (!remote->in_buffer) { | 468 | if (!remote->in_buffer) { |
469 | error = -ENOMEM; | 469 | error = -ENOMEM; |
470 | goto fail1; | 470 | goto fail1; |
@@ -543,7 +543,7 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic | |||
543 | return 0; | 543 | return 0; |
544 | 544 | ||
545 | fail3: usb_free_urb(remote->irq_urb); | 545 | fail3: usb_free_urb(remote->irq_urb); |
546 | fail2: usb_buffer_free(udev, RECV_SIZE, remote->in_buffer, remote->in_dma); | 546 | fail2: usb_free_coherent(udev, RECV_SIZE, remote->in_buffer, remote->in_dma); |
547 | fail1: kfree(remote); | 547 | fail1: kfree(remote); |
548 | input_free_device(input_dev); | 548 | input_free_device(input_dev); |
549 | 549 | ||
@@ -564,7 +564,7 @@ static void keyspan_disconnect(struct usb_interface *interface) | |||
564 | input_unregister_device(remote->input); | 564 | input_unregister_device(remote->input); |
565 | usb_kill_urb(remote->irq_urb); | 565 | usb_kill_urb(remote->irq_urb); |
566 | usb_free_urb(remote->irq_urb); | 566 | usb_free_urb(remote->irq_urb); |
567 | usb_buffer_free(remote->udev, RECV_SIZE, remote->in_buffer, remote->in_dma); | 567 | usb_free_coherent(remote->udev, RECV_SIZE, remote->in_buffer, remote->in_dma); |
568 | kfree(remote); | 568 | kfree(remote); |
569 | } | 569 | } |
570 | } | 570 | } |
diff --git a/drivers/input/misc/powermate.c b/drivers/input/misc/powermate.c index 668913d12044..bf170f6b4422 100644 --- a/drivers/input/misc/powermate.c +++ b/drivers/input/misc/powermate.c | |||
@@ -64,7 +64,6 @@ struct powermate_device { | |||
64 | dma_addr_t data_dma; | 64 | dma_addr_t data_dma; |
65 | struct urb *irq, *config; | 65 | struct urb *irq, *config; |
66 | struct usb_ctrlrequest *configcr; | 66 | struct usb_ctrlrequest *configcr; |
67 | dma_addr_t configcr_dma; | ||
68 | struct usb_device *udev; | 67 | struct usb_device *udev; |
69 | struct input_dev *input; | 68 | struct input_dev *input; |
70 | spinlock_t lock; | 69 | spinlock_t lock; |
@@ -182,8 +181,6 @@ static void powermate_sync_state(struct powermate_device *pm) | |||
182 | usb_fill_control_urb(pm->config, pm->udev, usb_sndctrlpipe(pm->udev, 0), | 181 | usb_fill_control_urb(pm->config, pm->udev, usb_sndctrlpipe(pm->udev, 0), |
183 | (void *) pm->configcr, NULL, 0, | 182 | (void *) pm->configcr, NULL, 0, |
184 | powermate_config_complete, pm); | 183 | powermate_config_complete, pm); |
185 | pm->config->setup_dma = pm->configcr_dma; | ||
186 | pm->config->transfer_flags |= URB_NO_SETUP_DMA_MAP; | ||
187 | 184 | ||
188 | if (usb_submit_urb(pm->config, GFP_ATOMIC)) | 185 | if (usb_submit_urb(pm->config, GFP_ATOMIC)) |
189 | printk(KERN_ERR "powermate: usb_submit_urb(config) failed"); | 186 | printk(KERN_ERR "powermate: usb_submit_urb(config) failed"); |
@@ -276,13 +273,12 @@ static int powermate_input_event(struct input_dev *dev, unsigned int type, unsig | |||
276 | 273 | ||
277 | static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_device *pm) | 274 | static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_device *pm) |
278 | { | 275 | { |
279 | pm->data = usb_buffer_alloc(udev, POWERMATE_PAYLOAD_SIZE_MAX, | 276 | pm->data = usb_alloc_coherent(udev, POWERMATE_PAYLOAD_SIZE_MAX, |
280 | GFP_ATOMIC, &pm->data_dma); | 277 | GFP_ATOMIC, &pm->data_dma); |
281 | if (!pm->data) | 278 | if (!pm->data) |
282 | return -1; | 279 | return -1; |
283 | 280 | ||
284 | pm->configcr = usb_buffer_alloc(udev, sizeof(*(pm->configcr)), | 281 | pm->configcr = kmalloc(sizeof(*(pm->configcr)), GFP_KERNEL); |
285 | GFP_ATOMIC, &pm->configcr_dma); | ||
286 | if (!pm->configcr) | 282 | if (!pm->configcr) |
287 | return -1; | 283 | return -1; |
288 | 284 | ||
@@ -291,10 +287,9 @@ static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_dev | |||
291 | 287 | ||
292 | static void powermate_free_buffers(struct usb_device *udev, struct powermate_device *pm) | 288 | static void powermate_free_buffers(struct usb_device *udev, struct powermate_device *pm) |
293 | { | 289 | { |
294 | usb_buffer_free(udev, POWERMATE_PAYLOAD_SIZE_MAX, | 290 | usb_free_coherent(udev, POWERMATE_PAYLOAD_SIZE_MAX, |
295 | pm->data, pm->data_dma); | 291 | pm->data, pm->data_dma); |
296 | usb_buffer_free(udev, sizeof(*(pm->configcr)), | 292 | kfree(pm->configcr); |
297 | pm->configcr, pm->configcr_dma); | ||
298 | } | 293 | } |
299 | 294 | ||
300 | /* Called whenever a USB device matching one in our supported devices table is connected */ | 295 | /* Called whenever a USB device matching one in our supported devices table is connected */ |
diff --git a/drivers/input/misc/yealink.c b/drivers/input/misc/yealink.c index 93a22ac0f88c..41201c6b5e68 100644 --- a/drivers/input/misc/yealink.c +++ b/drivers/input/misc/yealink.c | |||
@@ -111,7 +111,6 @@ struct yealink_dev { | |||
111 | struct yld_ctl_packet *ctl_data; | 111 | struct yld_ctl_packet *ctl_data; |
112 | dma_addr_t ctl_dma; | 112 | dma_addr_t ctl_dma; |
113 | struct usb_ctrlrequest *ctl_req; | 113 | struct usb_ctrlrequest *ctl_req; |
114 | dma_addr_t ctl_req_dma; | ||
115 | struct urb *urb_ctl; | 114 | struct urb *urb_ctl; |
116 | 115 | ||
117 | char phys[64]; /* physical device path */ | 116 | char phys[64]; /* physical device path */ |
@@ -836,12 +835,9 @@ static int usb_cleanup(struct yealink_dev *yld, int err) | |||
836 | usb_free_urb(yld->urb_irq); | 835 | usb_free_urb(yld->urb_irq); |
837 | usb_free_urb(yld->urb_ctl); | 836 | usb_free_urb(yld->urb_ctl); |
838 | 837 | ||
839 | usb_buffer_free(yld->udev, sizeof(*(yld->ctl_req)), | 838 | kfree(yld->ctl_req); |
840 | yld->ctl_req, yld->ctl_req_dma); | 839 | usb_free_coherent(yld->udev, USB_PKT_LEN, yld->ctl_data, yld->ctl_dma); |
841 | usb_buffer_free(yld->udev, USB_PKT_LEN, | 840 | usb_free_coherent(yld->udev, USB_PKT_LEN, yld->irq_data, yld->irq_dma); |
842 | yld->ctl_data, yld->ctl_dma); | ||
843 | usb_buffer_free(yld->udev, USB_PKT_LEN, | ||
844 | yld->irq_data, yld->irq_dma); | ||
845 | 841 | ||
846 | kfree(yld); | 842 | kfree(yld); |
847 | return err; | 843 | return err; |
@@ -886,18 +882,17 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
886 | return usb_cleanup(yld, -ENOMEM); | 882 | return usb_cleanup(yld, -ENOMEM); |
887 | 883 | ||
888 | /* allocate usb buffers */ | 884 | /* allocate usb buffers */ |
889 | yld->irq_data = usb_buffer_alloc(udev, USB_PKT_LEN, | 885 | yld->irq_data = usb_alloc_coherent(udev, USB_PKT_LEN, |
890 | GFP_ATOMIC, &yld->irq_dma); | 886 | GFP_ATOMIC, &yld->irq_dma); |
891 | if (yld->irq_data == NULL) | 887 | if (yld->irq_data == NULL) |
892 | return usb_cleanup(yld, -ENOMEM); | 888 | return usb_cleanup(yld, -ENOMEM); |
893 | 889 | ||
894 | yld->ctl_data = usb_buffer_alloc(udev, USB_PKT_LEN, | 890 | yld->ctl_data = usb_alloc_coherent(udev, USB_PKT_LEN, |
895 | GFP_ATOMIC, &yld->ctl_dma); | 891 | GFP_ATOMIC, &yld->ctl_dma); |
896 | if (!yld->ctl_data) | 892 | if (!yld->ctl_data) |
897 | return usb_cleanup(yld, -ENOMEM); | 893 | return usb_cleanup(yld, -ENOMEM); |
898 | 894 | ||
899 | yld->ctl_req = usb_buffer_alloc(udev, sizeof(*(yld->ctl_req)), | 895 | yld->ctl_req = kmalloc(sizeof(*(yld->ctl_req)), GFP_KERNEL); |
900 | GFP_ATOMIC, &yld->ctl_req_dma); | ||
901 | if (yld->ctl_req == NULL) | 896 | if (yld->ctl_req == NULL) |
902 | return usb_cleanup(yld, -ENOMEM); | 897 | return usb_cleanup(yld, -ENOMEM); |
903 | 898 | ||
@@ -936,10 +931,8 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
936 | usb_fill_control_urb(yld->urb_ctl, udev, usb_sndctrlpipe(udev, 0), | 931 | usb_fill_control_urb(yld->urb_ctl, udev, usb_sndctrlpipe(udev, 0), |
937 | (void *)yld->ctl_req, yld->ctl_data, USB_PKT_LEN, | 932 | (void *)yld->ctl_req, yld->ctl_data, USB_PKT_LEN, |
938 | urb_ctl_callback, yld); | 933 | urb_ctl_callback, yld); |
939 | yld->urb_ctl->setup_dma = yld->ctl_req_dma; | ||
940 | yld->urb_ctl->transfer_dma = yld->ctl_dma; | 934 | yld->urb_ctl->transfer_dma = yld->ctl_dma; |
941 | yld->urb_ctl->transfer_flags |= URB_NO_SETUP_DMA_MAP | | 935 | yld->urb_ctl->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; |
942 | URB_NO_TRANSFER_DMA_MAP; | ||
943 | yld->urb_ctl->dev = udev; | 936 | yld->urb_ctl->dev = udev; |
944 | 937 | ||
945 | /* find out the physical bus location */ | 938 | /* find out the physical bus location */ |