Commit ba1582f2 authored by Felipe F. Tonello's avatar Felipe F. Tonello Committed by Felipe Balbi

usb: gadget: f_hid: use alloc_ep_req()

Use gadget's framework allocation function instead of directly calling
usb_ep_alloc_request().
Signed-off-by: default avatarFelipe F. Tonello <eu@felipetonello.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 14794d71
...@@ -617,14 +617,10 @@ static int hidg_bind(struct usb_configuration *c, struct usb_function *f) ...@@ -617,14 +617,10 @@ static int hidg_bind(struct usb_configuration *c, struct usb_function *f)
/* preallocate request and buffer */ /* preallocate request and buffer */
status = -ENOMEM; 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) if (!hidg->req)
goto fail; goto fail;
hidg->req->buf = kmalloc(hidg->report_length, GFP_KERNEL);
if (!hidg->req->buf)
goto fail;
/* set descriptor dynamic values */ /* set descriptor dynamic values */
hidg_interface_desc.bInterfaceSubClass = hidg->bInterfaceSubClass; hidg_interface_desc.bInterfaceSubClass = hidg->bInterfaceSubClass;
hidg_interface_desc.bInterfaceProtocol = hidg->bInterfaceProtocol; hidg_interface_desc.bInterfaceProtocol = hidg->bInterfaceProtocol;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment