mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
To: barebox@lists.infradead.org
Cc: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Subject: [PATCH 2/2] usb:gadget: use helper function to queue composite requests
Date: Tue, 14 May 2024 15:03:27 +0200	[thread overview]
Message-ID: <20240514130327.2988227-2-enrico.scholz@sigma-chemnitz.de> (raw)
In-Reply-To: <20240514130327.2988227-1-enrico.scholz@sigma-chemnitz.de>

From: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>

Fixes bookkeeping in composite driver.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
---
 drivers/usb/gadget/function/dfu.c   | 2 +-
 drivers/usb/gadget/function/f_acm.c | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/function/dfu.c b/drivers/usb/gadget/function/dfu.c
index 3a6d2cf385b1..a41ff22dcebc 100644
--- a/drivers/usb/gadget/function/dfu.c
+++ b/drivers/usb/gadget/function/dfu.c
@@ -807,7 +807,7 @@ static int dfu_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
 	if (value >= 0) {
 		req->zero = 0;
 		req->length = value;
-		value = usb_ep_queue(cdev->gadget->ep0, req);
+		value = composite_queue_setup_request(cdev);
 		if (value < 0)
 			ERROR(cdev, "dfu response on ttyGS%d, err %d\n",
 					dfu->port_num, value);
diff --git a/drivers/usb/gadget/function/f_acm.c b/drivers/usb/gadget/function/f_acm.c
index 3532fd589274..7fa0a4358fe6 100644
--- a/drivers/usb/gadget/function/f_acm.c
+++ b/drivers/usb/gadget/function/f_acm.c
@@ -309,6 +309,8 @@ static void acm_complete_set_line_coding(struct usb_ep *ep,
 	struct f_acm	*acm = ep->driver_data;
 	struct usb_composite_dev *cdev = acm->port.func.config->cdev;
 
+	composite_setup_complete(ep, req);
+
 	if (req->status != 0) {
 		DBG(cdev, "acm ttyGS%d completion, err %d\n",
 				acm->port_num, req->status);
@@ -406,7 +408,7 @@ static int acm_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
 			w_value, w_index, w_length);
 		req->zero = 0;
 		req->length = value;
-		value = usb_ep_queue(cdev->gadget->ep0, req);
+		value = composite_queue_setup_request(cdev);
 		if (value < 0)
 			ERROR(cdev, "acm response on ttyGS%d, err %d\n",
 					acm->port_num, value);
-- 
2.45.0




  reply	other threads:[~2024-05-14 13:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-14 13:03 [PATCH 1/2] usb:gadget:composite: add public functions for managing setup requests Enrico Scholz
2024-05-14 13:03 ` Enrico Scholz [this message]
2024-05-15  6:07 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240514130327.2988227-2-enrico.scholz@sigma-chemnitz.de \
    --to=enrico.scholz@sigma-chemnitz.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox