aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/usbhid
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2008-11-24 10:20:06 -0500
committerJiri Kosina <jkosina@suse.cz>2009-01-03 19:00:52 -0500
commit898089d08f983ef0fdb176267620543a7929826a (patch)
treec654a7c5c2ea35d8cf01bb0f849c51ed198d0249 /drivers/hid/usbhid
parent581a2739607b5fdfb6b22d6083fc7f83c441077f (diff)
HID: use GFP_KERNEL in hid_alloc_buffers
We might sleep, so no problem to use GFP_KERNEL. While at it bring the function to coding style. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/usbhid')
-rw-r--r--drivers/hid/usbhid/hid-core.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 832e469265ee..03cb494af1c5 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -651,13 +651,16 @@ static int hid_alloc_buffers(struct usb_device *dev, struct hid_device *hid)
651{ 651{
652 struct usbhid_device *usbhid = hid->driver_data; 652 struct usbhid_device *usbhid = hid->driver_data;
653 653
654 if (!(usbhid->inbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_ATOMIC, &usbhid->inbuf_dma))) 654 usbhid->inbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL,
655 return -1; 655 &usbhid->inbuf_dma);
656 if (!(usbhid->outbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_ATOMIC, &usbhid->outbuf_dma))) 656 usbhid->outbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL,
657 return -1; 657 &usbhid->outbuf_dma);
658 if (!(usbhid->cr = usb_buffer_alloc(dev, sizeof(*(usbhid->cr)), GFP_ATOMIC, &usbhid->cr_dma))) 658 usbhid->cr = usb_buffer_alloc(dev, sizeof(*usbhid->cr), GFP_KERNEL,
659 return -1; 659 &usbhid->cr_dma);
660 if (!(usbhid->ctrlbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_ATOMIC, &usbhid->ctrlbuf_dma))) 660 usbhid->ctrlbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL,
661 &usbhid->ctrlbuf_dma);
662 if (!usbhid->inbuf || !usbhid->outbuf || !usbhid->cr ||
663 !usbhid->ctrlbuf)
661 return -1; 664 return -1;
662 665
663 return 0; 666 return 0;