mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] usb: host: Use helper function to get endpoint
@ 2022-08-24 13:07 Khalid Masum
  2022-08-24 14:40 ` Alan Stern
  0 siblings, 1 reply; 6+ messages in thread
From: Khalid Masum @ 2022-08-24 13:07 UTC (permalink / raw)
  To: linux-usb, linux-kernel
  Cc: Greg Kroah-Hartman, Alan Stern, Kishon Vijay Abraham I,
	Arnd Bergmann, Matthias Kaehlcke, Alexey Sheplyakov, Weitao Wang,
	linux-kernel-mentees, Khalid Masum

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-08-24 20:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-24 13:07 [PATCH] usb: host: Use helper function to get endpoint Khalid Masum
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

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®