diff options
Diffstat (limited to 'drivers/usb/gadget/f_hid.c')
-rw-r--r-- | drivers/usb/gadget/f_hid.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/drivers/usb/gadget/f_hid.c b/drivers/usb/gadget/f_hid.c index 6e69a8e8d22a..a95290a1289f 100644 --- a/drivers/usb/gadget/f_hid.c +++ b/drivers/usb/gadget/f_hid.c | |||
@@ -20,6 +20,8 @@ | |||
20 | #include <linux/sched.h> | 20 | #include <linux/sched.h> |
21 | #include <linux/usb/g_hid.h> | 21 | #include <linux/usb/g_hid.h> |
22 | 22 | ||
23 | #include "u_f.h" | ||
24 | |||
23 | static int major, minors; | 25 | static int major, minors; |
24 | static struct class *hidg_class; | 26 | static struct class *hidg_class; |
25 | 27 | ||
@@ -334,20 +336,10 @@ static int f_hidg_open(struct inode *inode, struct file *fd) | |||
334 | /*-------------------------------------------------------------------------*/ | 336 | /*-------------------------------------------------------------------------*/ |
335 | /* usb_function */ | 337 | /* usb_function */ |
336 | 338 | ||
337 | static struct usb_request *hidg_alloc_ep_req(struct usb_ep *ep, unsigned length) | 339 | static inline struct usb_request *hidg_alloc_ep_req(struct usb_ep *ep, |
340 | unsigned length) | ||
338 | { | 341 | { |
339 | struct usb_request *req; | 342 | return alloc_ep_req(ep, length, length); |
340 | |||
341 | req = usb_ep_alloc_request(ep, GFP_ATOMIC); | ||
342 | if (req) { | ||
343 | req->length = length; | ||
344 | req->buf = kmalloc(length, GFP_ATOMIC); | ||
345 | if (!req->buf) { | ||
346 | usb_ep_free_request(ep, req); | ||
347 | req = NULL; | ||
348 | } | ||
349 | } | ||
350 | return req; | ||
351 | } | 343 | } |
352 | 344 | ||
353 | static void hidg_set_report_complete(struct usb_ep *ep, struct usb_request *req) | 345 | static void hidg_set_report_complete(struct usb_ep *ep, struct usb_request *req) |