usb: Provide usb_speed_string() function
authorMichal Nazarewicz <mina86@mina86.com>
Tue, 30 Aug 2011 15:11:19 +0000 (17:11 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 18 Sep 2011 08:29:04 +0000 (01:29 -0700)
commite538dfdae85244fd2c4231725d82cc1f1bc4942c
treef8471dd9af305b95557d29a30f427c85418b1621
parentc58a76cdd7ab5a945a44fd2d64f6faf40323f95b
usb: Provide usb_speed_string() function

In a few places in the kernel, the code prints
a human-readable USB device speed (eg. "high speed").
This involves a switch statement sometimes wrapped
around in ({ ... }) block leading to code repetition.

To mitigate this issue, this commit introduces
usb_speed_string() function, which returns
a human-readable name of provided speed.

It also changes a few places switch was used to use
this new function.  This changes a bit the way the
speed is printed in few instances at the same time
standardising it.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 files changed:
drivers/usb/Kconfig
drivers/usb/Makefile
drivers/usb/core/hub.c
drivers/usb/gadget/amd5536udc.c
drivers/usb/gadget/atmel_usba_udc.c
drivers/usb/gadget/composite.c
drivers/usb/gadget/file_storage.c
drivers/usb/gadget/fsl_udc_core.c
drivers/usb/gadget/gmidi.c
drivers/usb/gadget/langwell_udc.c
drivers/usb/gadget/net2272.c
drivers/usb/gadget/net2280.c
drivers/usb/gadget/printer.c
drivers/usb/gadget/s3c-hsotg.c
drivers/usb/gadget/udc-core.c
drivers/usb/misc/usbtest.c
drivers/usb/usb-common.c [new file with mode: 0644]
include/linux/usb/ch9.h