Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1468733 > unrolled thread

[PATCH 0/3] Gadget endpoint allocation request

Started by"Felipe F. Tonello" <eu@felipetonello.com>
First post2016-08-23 19:30 +0200
Last post2016-08-23 19:30 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/3] Gadget endpoint allocation request "Felipe F. Tonello" <eu@felipetonello.com> - 2016-08-23 19:30 +0200
    [PATCH 3/3] usb: gadget: f_hid: use alloc_ep_req() "Felipe F. Tonello" <eu@felipetonello.com> - 2016-08-23 19:30 +0200

#1468733 — [PATCH 0/3] Gadget endpoint allocation request

From"Felipe F. Tonello" <eu@felipetonello.com>
Date2016-08-23 19:30 +0200
Subject[PATCH 0/3] Gadget endpoint allocation request
Message-ID<s9nGp-72m-5@gated-at.bofh.it>
Patch #1 removes a unnecessary and confusing parameter from alloc_ep_req().
Also, this series updates f_hid function to use alloc/free_ep_req() instead of
allocating/freeing requests directly.

Felipe F. Tonello (3):
  usb: gadget: remove useless parameter in alloc_ep_req()
  usb: gadget: f_hid: use free_ep_req()
  usb: gadget: f_hid: use alloc_ep_req()

 drivers/usb/gadget/function/f_hid.c        | 18 +++++-------------
 drivers/usb/gadget/function/f_loopback.c   |  6 ++----
 drivers/usb/gadget/function/f_midi.c       |  2 +-
 drivers/usb/gadget/function/f_sourcesink.c |  6 ++----
 drivers/usb/gadget/u_f.c                   |  7 +++----
 drivers/usb/gadget/u_f.h                   |  3 +--
 6 files changed, 14 insertions(+), 28 deletions(-)

-- 
2.9.3

[toc] | [next] | [standalone]


#1468734 — [PATCH 3/3] usb: gadget: f_hid: use alloc_ep_req()

From"Felipe F. Tonello" <eu@felipetonello.com>
Date2016-08-23 19:30 +0200
Subject[PATCH 3/3] usb: gadget: f_hid: use alloc_ep_req()
Message-ID<s9nGp-72m-7@gated-at.bofh.it>
In reply to#1468733
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 aa1c19946d10..e2966f87c860 100644
--- a/drivers/usb/gadget/function/f_hid.c
+++ b/drivers/usb/gadget/function/f_hid.c
@@ -617,14 +617,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.3

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web