usb: introduce usb_ep_type_string() function
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Thu, 21 Mar 2019 02:27:56 +0000 (10:27 +0800)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Fri, 3 May 2019 06:13:48 +0000 (09:13 +0300)
commit4035c5b5f2e13b96b6dd5a6d746adad269f832cf
tree307a39e408a56daca32ef78181fee053257031f2
parent41a91c606e7d2b74358a944525267cc451c271e8
usb: introduce usb_ep_type_string() function

In some places, the code prints a human-readable USB endpoint
transfer type (e.g. "bulk"). This involves a switch statement
sometimes wrapped around in ({ ... }) block leading to code
repetition.
To make this scenario easier, here introduces usb_ep_type_string()
function, which returns a human-readable name of provided
endpoint type.
It also changes a few places switch was used to use this
new function.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/common/common.c
drivers/usb/core/hcd.c
drivers/usb/gadget/udc/aspeed-vhub/epn.c
drivers/usb/gadget/udc/dummy_hcd.c
include/linux/usb/ch9.h