summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorVincent Mailhol <mailhol.vincent@wanadoo.fr>2022-03-17 06:55:14 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-23 11:33:53 +0300
commitbdddc253b0938a0063798881d1f6a971ea1d8943 (patch)
tree3975c01aed8778f9680d52d428ea46fc307b1846 /include/linux
parent2ddf7617d568fdcbd3cc454bb4849fa6d3398c86 (diff)
downloadlinux-bdddc253b0938a0063798881d1f6a971ea1d8943.tar.xz
usb: rework usb_maxpacket() using usb_pipe_endpoint()
Rework the body of usb_maxpacket() and just rely on the usb_pipe_endpoint() helper function to retrieve the host endpoint instead of doing it by hand. Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Link: https://lore.kernel.org/r/20220317035514.6378-10-mailhol.vincent@wanadoo.fr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/usb.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 8127782aa7a1..60bee864d897 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -1971,13 +1971,7 @@ usb_pipe_endpoint(struct usb_device *dev, unsigned int pipe)
static inline u16 usb_maxpacket(struct usb_device *udev, int pipe)
{
- struct usb_host_endpoint *ep;
- unsigned epnum = usb_pipeendpoint(pipe);
-
- if (usb_pipeout(pipe))
- ep = udev->ep_out[epnum];
- else
- ep = udev->ep_in[epnum];
+ struct usb_host_endpoint *ep = usb_pipe_endpoint(udev, pipe);
if (!ep)
return 0;