Thread (6 messages) 6 messages, 2 authors, 2022-08-24

[PATCH] usb: host: Use helper function to get endpoint

From: Khalid Masum <hidden>
Date: 2022-08-24 13:07:40
Also in: linux-usb, lkml
Subsystem: the rest, usb subsystem · Maintainers: Linus Torvalds, Greg Kroah-Hartman

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 <redacted>
---
 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

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help