diff options
| author | Felipe F. Tonello <eu@felipetonello.com> | 2016-08-23 18:24:51 +0100 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-01-08 07:53:03 -0800 |
| commit | 66823b1c835b352fcdd32536627bd6537edd15fb (patch) | |
| tree | bbed5e3813cac61d8a103a1debae07c1a51a8643 | |
| parent | 5ac717112b1ce8095ede2c02019116cf689315c6 (diff) | |
usb: gadget: f_hid: use alloc_ep_req()
Use gadget's framework allocation function instead of directly calling
usb_ep_alloc_request().
Change-Id: I247b0d325f553a1cb363f35def2b1aa4c0385dd0
Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Git-commit: ba1582f22231821c57534e87b077d84adbc15dbd
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
| -rw-r--r-- | drivers/usb/gadget/function/f_hid.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c index 1c9963ffbe35..a99ae39daed4 100644 --- a/drivers/usb/gadget/function/f_hid.c +++ b/drivers/usb/gadget/function/f_hid.c @@ -633,14 +633,10 @@ static int hidg_bind(struct usb_configuration *c, struct usb_function *f) /* preallocate request and buffer */ status = -ENOMEM; - hidg->req = usb_ep_alloc_request(hidg->in_ep, GFP_KERNEL); + hidg->req = alloc_ep_req(hidg->in_ep, hidg->report_length); if (!hidg->req) goto fail; - hidg->req->buf = kmalloc(hidg->report_length, GFP_KERNEL); - if (!hidg->req->buf) - goto fail; - /* set descriptor dynamic values */ hidg_interface_desc.bInterfaceSubClass = hidg->bInterfaceSubClass; hidg_interface_desc.bInterfaceProtocol = hidg->bInterfaceProtocol; |
