aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2010-04-12 07:17:25 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-20 16:21:38 -0400
commit997ea58eb92f9970b8af7aae48800d0ef43b9423 (patch)
tree65e021973e5a48ad7290d5be1f441940566468ad /drivers/hid
parent48679c6d772b1459a2945729e3a1256ac78fcabf (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/hid')
-rw-r--r--drivers/hid/usbhid/hid-core.c12
-rw-r--r--drivers/hid/usbhid/usbkbd.c8
-rw-r--r--drivers/hid/usbhid/usbmouse.c6
3 files changed, 13 insertions, 13 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 6a510c9675fc..df619756b7ae 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -783,12 +783,12 @@ static int hid_alloc_buffers(struct usb_device *dev, struct hid_device *hid)
783{ 783{
784 struct usbhid_device *usbhid = hid->driver_data; 784 struct usbhid_device *usbhid = hid->driver_data;
785 785
786 usbhid->inbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL, 786 usbhid->inbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL,
787 &usbhid->inbuf_dma); 787 &usbhid->inbuf_dma);
788 usbhid->outbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL, 788 usbhid->outbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL,
789 &usbhid->outbuf_dma); 789 &usbhid->outbuf_dma);
790 usbhid->cr = kmalloc(sizeof(*usbhid->cr), GFP_KERNEL); 790 usbhid->cr = kmalloc(sizeof(*usbhid->cr), GFP_KERNEL);
791 usbhid->ctrlbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL, 791 usbhid->ctrlbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL,
792 &usbhid->ctrlbuf_dma); 792 &usbhid->ctrlbuf_dma);
793 if (!usbhid->inbuf || !usbhid->outbuf || !usbhid->cr || 793 if (!usbhid->inbuf || !usbhid->outbuf || !usbhid->cr ||
794 !usbhid->ctrlbuf) 794 !usbhid->ctrlbuf)
@@ -843,10 +843,10 @@ static void hid_free_buffers(struct usb_device *dev, struct hid_device *hid)
843{ 843{
844 struct usbhid_device *usbhid = hid->driver_data; 844 struct usbhid_device *usbhid = hid->driver_data;
845 845
846 usb_buffer_free(dev, usbhid->bufsize, usbhid->inbuf, usbhid->inbuf_dma); 846 usb_free_coherent(dev, usbhid->bufsize, usbhid->inbuf, usbhid->inbuf_dma);
847 usb_buffer_free(dev, usbhid->bufsize, usbhid->outbuf, usbhid->outbuf_dma); 847 usb_free_coherent(dev, usbhid->bufsize, usbhid->outbuf, usbhid->outbuf_dma);
848 kfree(usbhid->cr); 848 kfree(usbhid->cr);
849 usb_buffer_free(dev, usbhid->bufsize, usbhid->ctrlbuf, usbhid->ctrlbuf_dma); 849 usb_free_coherent(dev, usbhid->bufsize, usbhid->ctrlbuf, usbhid->ctrlbuf_dma);
850} 850}
851 851
852static int usbhid_parse(struct hid_device *hid) 852static int usbhid_parse(struct hid_device *hid)
diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c
index bdc7b09e8670..bb14c8270af3 100644
--- a/drivers/hid/usbhid/usbkbd.c
+++ b/drivers/hid/usbhid/usbkbd.c
@@ -196,11 +196,11 @@ static int usb_kbd_alloc_mem(struct usb_device *dev, struct usb_kbd *kbd)
196 return -1; 196 return -1;
197 if (!(kbd->led = usb_alloc_urb(0, GFP_KERNEL))) 197 if (!(kbd->led = usb_alloc_urb(0, GFP_KERNEL)))
198 return -1; 198 return -1;
199 if (!(kbd->new = usb_buffer_alloc(dev, 8, GFP_ATOMIC, &kbd->new_dma))) 199 if (!(kbd->new = usb_alloc_coherent(dev, 8, GFP_ATOMIC, &kbd->new_dma)))
200 return -1; 200 return -1;
201 if (!(kbd->cr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL))) 201 if (!(kbd->cr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL)))
202 return -1; 202 return -1;
203 if (!(kbd->leds = usb_buffer_alloc(dev, 1, GFP_ATOMIC, &kbd->leds_dma))) 203 if (!(kbd->leds = usb_alloc_coherent(dev, 1, GFP_ATOMIC, &kbd->leds_dma)))
204 return -1; 204 return -1;
205 205
206 return 0; 206 return 0;
@@ -210,9 +210,9 @@ static void usb_kbd_free_mem(struct usb_device *dev, struct usb_kbd *kbd)
210{ 210{
211 usb_free_urb(kbd->irq); 211 usb_free_urb(kbd->irq);
212 usb_free_urb(kbd->led); 212 usb_free_urb(kbd->led);
213 usb_buffer_free(dev, 8, kbd->new, kbd->new_dma); 213 usb_free_coherent(dev, 8, kbd->new, kbd->new_dma);
214 kfree(kbd->cr); 214 kfree(kbd->cr);
215 usb_buffer_free(dev, 1, kbd->leds, kbd->leds_dma); 215 usb_free_coherent(dev, 1, kbd->leds, kbd->leds_dma);
216} 216}
217 217
218static int usb_kbd_probe(struct usb_interface *iface, 218static int usb_kbd_probe(struct usb_interface *iface,
diff --git a/drivers/hid/usbhid/usbmouse.c b/drivers/hid/usbhid/usbmouse.c
index 72ab4b268096..79b2bf81a059 100644
--- a/drivers/hid/usbhid/usbmouse.c
+++ b/drivers/hid/usbhid/usbmouse.c
@@ -142,7 +142,7 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i
142 if (!mouse || !input_dev) 142 if (!mouse || !input_dev)
143 goto fail1; 143 goto fail1;
144 144
145 mouse->data = usb_buffer_alloc(dev, 8, GFP_ATOMIC, &mouse->data_dma); 145 mouse->data = usb_alloc_coherent(dev, 8, GFP_ATOMIC, &mouse->data_dma);
146 if (!mouse->data) 146 if (!mouse->data)
147 goto fail1; 147 goto fail1;
148 148
@@ -205,7 +205,7 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i
205fail3: 205fail3:
206 usb_free_urb(mouse->irq); 206 usb_free_urb(mouse->irq);
207fail2: 207fail2:
208 usb_buffer_free(dev, 8, mouse->data, mouse->data_dma); 208 usb_free_coherent(dev, 8, mouse->data, mouse->data_dma);
209fail1: 209fail1:
210 input_free_device(input_dev); 210 input_free_device(input_dev);
211 kfree(mouse); 211 kfree(mouse);
@@ -221,7 +221,7 @@ static void usb_mouse_disconnect(struct usb_interface *intf)
221 usb_kill_urb(mouse->irq); 221 usb_kill_urb(mouse->irq);
222 input_unregister_device(mouse->dev); 222 input_unregister_device(mouse->dev);
223 usb_free_urb(mouse->irq); 223 usb_free_urb(mouse->irq);
224 usb_buffer_free(interface_to_usbdev(intf), 8, mouse->data, mouse->data_dma); 224 usb_free_coherent(interface_to_usbdev(intf), 8, mouse->data, mouse->data_dma);
225 kfree(mouse); 225 kfree(mouse);
226 } 226 }
227} 227}