Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1458232
| From | "Felipe F. Tonello" <eu@felipetonello.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v4 10/10] usb: gadget: f_hid: use alloc_ep_req() |
| Date | 2016-08-08 22:40 +0200 |
| Message-ID | <s3Zv3-6cB-27@gated-at.bofh.it> (permalink) |
| References | <s3Zv3-6cB-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Use gadget's framework allocation function instead of directly calling usb_ep_alloc_request(). Signed-off-by: Felipe F. Tonello <eu@felipetonello.com> --- drivers/usb/gadget/function/f_hid.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c index a010496e4e05..89d2e9a5a04f 100644 --- a/drivers/usb/gadget/function/f_hid.c +++ b/drivers/usb/gadget/function/f_hid.c @@ -611,14 +611,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; -- 2.9.2
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v4 00/10] Gadget endpoint request allocation and MIDI "Felipe F. Tonello" <eu@felipetonello.com> - 2016-08-08 22:40 +0200 [PATCH v4 04/10] usb: gadget: f_midi: remove alignment code for OUT endpoint "Felipe F. Tonello" <eu@felipetonello.com> - 2016-08-08 22:40 +0200 [PATCH v4 03/10] usb: gadget: align buffer size when allocating for OUT endpoint "Felipe F. Tonello" <eu@felipetonello.com> - 2016-08-08 22:40 +0200 [PATCH v4 02/10] usb: gadget: change len to size_t on alloc_ep_req() "Felipe F. Tonello" <eu@felipetonello.com> - 2016-08-08 22:40 +0200 [PATCH v4 06/10] usb: gadget: f_midi: refactor state machine "Felipe F. Tonello" <eu@felipetonello.com> - 2016-08-08 22:40 +0200 [PATCH v4 09/10] usb: gadget: f_hid: use free_ep_req() "Felipe F. Tonello" <eu@felipetonello.com> - 2016-08-08 22:40 +0200 [PATCH v4 10/10] usb: gadget: f_hid: use alloc_ep_req() "Felipe F. Tonello" <eu@felipetonello.com> - 2016-08-08 22:40 +0200 [PATCH v4 05/10] usb: gadget: f_midi: defaults buflen sizes to 512 "Felipe F. Tonello" <eu@felipetonello.com> - 2016-08-08 22:40 +0200
csiph-web