mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Khalid Masum <khalid.masum.92@gmail.com>
To: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Matthias Kaehlcke <mka@chromium.org>,
	Alexey Sheplyakov <asheplyakov@basealt.ru>,
	Weitao Wang <WeitaoWang-oc@zhaoxin.com>,
	linux-kernel-mentees@lists.linuxfoundation.org,
	Khalid Masum <khalid.masum.92@gmail.com>
Subject: [PATCH] usb: host: Use helper function to get endpoint
Date: Wed, 24 Aug 2022 19:07:02 +0600	[thread overview]
Message-ID: <20220824130702.10912-1-khalid.masum.92@gmail.com> (raw)

Current implementation to convert urb pipe number to struct 
usb_host_endpoint in rquest_single_step_set_feature_urb is a little
messy. 

Use usb_pipe_endpoint helper function to get the endpoint instead.

Signed-off-by: Khalid Masum <khalid.masum.92@gmail.com>
---
 drivers/usb/core/hcd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 94b305bbd621..107e29d5d3ae 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -2165,8 +2165,7 @@ static struct urb *request_single_step_set_feature_urb(
 		return NULL;
 
 	urb->pipe = usb_rcvctrlpipe(udev, 0);
-	ep = (usb_pipein(urb->pipe) ? udev->ep_in : udev->ep_out)
-				[usb_pipeendpoint(urb->pipe)];
+	ep = usb_pipe_endpoint(udev, urb->pipe);
 	if (!ep) {
 		usb_free_urb(urb);
 		return NULL;
-- 
2.37.1


             reply	other threads:[~2022-08-24 13:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-24 13:07 Khalid Masum [this message]
2022-08-24 14:40 ` Alan Stern
2022-08-24 16:55   ` Khalid Masum
2022-08-24 17:57   ` Khalid Masum
2022-08-24 19:24     ` Alan Stern
2022-08-24 20:36       ` Khalid Masum

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=20220824130702.10912-1-khalid.masum.92@gmail.com \
    --to=khalid.masum.92@gmail.com \
    --cc=WeitaoWang-oc@zhaoxin.com \
    --cc=arnd@arndb.de \
    --cc=asheplyakov@basealt.ru \
    --cc=gregkh@linuxfoundation.org \
    --cc=kishon@ti.com \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mka@chromium.org \
    --cc=stern@rowland.harvard.edu \
    /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

all inboxes | Powered by JetHome®