]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
usb: host: xhci: make use of new usb_endpoint_maxp_mult()
authorFelipe Balbi <felipe.balbi@linux.intel.com>
Wed, 28 Sep 2016 10:39:22 +0000 (13:39 +0300)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Thu, 3 Nov 2016 08:38:21 +0000 (10:38 +0200)
We have introduced a helper to calculate multiplier
value from wMaxPacketSize. Start using it.

Cc: Mathias Nyman <mathias.nyman@intel.com>
Cc: <linux-usb@vger.kernel.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/host/xhci-mem.c

index 6afe32381209d76cd0cf2f46d686a9f07a43f2c9..679672da58ed9dbc73e9473abb7d9b8d385d8041 100644 (file)
@@ -1370,7 +1370,7 @@ static u32 xhci_get_endpoint_max_burst(struct usb_device *udev,
        if (udev->speed == USB_SPEED_HIGH &&
            (usb_endpoint_xfer_isoc(&ep->desc) ||
             usb_endpoint_xfer_int(&ep->desc)))
-               return (usb_endpoint_maxp(&ep->desc) & 0x1800) >> 11;
+               return usb_endpoint_maxp_mult(&ep->desc) - 1;
 
        return 0;
 }
@@ -1416,9 +1416,9 @@ static u32 xhci_get_max_esit_payload(struct usb_device *udev,
                return le16_to_cpu(ep->ss_ep_comp.wBytesPerInterval);
 
        max_packet = GET_MAX_PACKET(usb_endpoint_maxp(&ep->desc));
-       max_burst = (usb_endpoint_maxp(&ep->desc) & 0x1800) >> 11;
+       max_burst = usb_endpoint_maxp_mult(&ep->desc);
        /* A 0 in max burst means 1 transfer per ESIT */
-       return max_packet * (max_burst + 1);
+       return max_packet * max_burst;
 }
 
 /* Set up an endpoint with one ring segment.  Do not allocate stream rings.