From: Felipe Balbi Date: Wed, 28 Sep 2016 10:27:55 +0000 (+0300) Subject: usb: core: devices: make use of new usb_endpoint_maxp_mult() X-Git-Tag: v4.10-rc1~150^2~57^2~150 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=91f97521bb3f42f7a0447c130c789cb7c1810714;p=platform%2Fkernel%2Flinux-exynos.git usb: core: devices: make use of new usb_endpoint_maxp_mult() We have introduced a helper to calculate multiplier value from wMaxPacketSize. Start using it. Cc: Greg Kroah-Hartman Cc: Acked-by: Greg Kroah-Hartman Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c index ef04b50..00d1b26 100644 --- a/drivers/usb/core/devices.c +++ b/drivers/usb/core/devices.c @@ -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)) {