diff options
author | Ricardo Ribalda | 2022-04-01 19:24:36 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab | 2022-05-08 07:10:06 +0200 |
commit | c89d3bbbfc1125b0784bdc1ff76d3fd564e38c97 (patch) | |
tree | fe2cc651b57be448eccf5a71070be491e2d994fe /drivers/media/usb/uvc | |
parent | 18a9b21f7a9d417ac07e2d2717a6a9679b664627 (diff) |
media: uvcvideo: Simplify uvc_endpoint_max_bpi()
The case USB_SPEED_WIRELESS and the default one were doing the same.
Also, make always use of usb_endpoint_maxp_mult, as it should have a
sane value, even for LOW speed and WIRELESS.
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/usb/uvc')
-rw-r--r-- | drivers/media/usb/uvc/uvc_video.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c index e016f88bdf96..6712982abafb 100644 --- a/drivers/media/usb/uvc/uvc_video.c +++ b/drivers/media/usb/uvc/uvc_video.c @@ -1758,21 +1758,14 @@ static unsigned int uvc_endpoint_max_bpi(struct usb_device *dev, struct usb_host_endpoint *ep) { u16 psize; - u16 mult; switch (dev->speed) { case USB_SPEED_SUPER: case USB_SPEED_SUPER_PLUS: return le16_to_cpu(ep->ss_ep_comp.wBytesPerInterval); - case USB_SPEED_HIGH: - psize = usb_endpoint_maxp(&ep->desc); - mult = usb_endpoint_maxp_mult(&ep->desc); - return psize * mult; - case USB_SPEED_WIRELESS: - psize = usb_endpoint_maxp(&ep->desc); - return psize; default: psize = usb_endpoint_maxp(&ep->desc); + psize *= usb_endpoint_maxp_mult(&ep->desc); return psize; } } |