usb: core: devices: make use of new usb_endpoint_maxp_mult()
authorFelipe Balbi <felipe.balbi@linux.intel.com>
Wed, 28 Sep 2016 10:27:55 +0000 (13:27 +0300)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Thu, 3 Nov 2016 08:38:17 +0000 (10:38 +0200)
We have introduced a helper to calculate multiplier
value from wMaxPacketSize. Start using it.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: <linux-usb@vger.kernel.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/core/devices.c

index ef04b50..00d1b26 100644 (file)
@@ -182,14 +182,8 @@ static char *usb_dump_endpoint_descriptor(int speed, char *start, char *end,
 
        dir = usb_endpoint_dir_in(desc) ? 'I' : 'O';
 
-       if (speed == USB_SPEED_HIGH) {
-               switch (usb_endpoint_maxp(desc) & (0x03 << 11)) {
-               case 1 << 11:
-                       bandwidth = 2; break;
-               case 2 << 11:
-                       bandwidth = 3; break;
-               }
-       }
+       if (speed == USB_SPEED_HIGH)
+               bandwidth = usb_endpoint_maxp_mult(desc);
 
        /* this isn't checking for illegal values */
        switch (usb_endpoint_type(desc)) {