]> asedeno.scripts.mit.edu Git - linux.git/commit
usb: introduce usb_ep_type_string() function
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Thu, 21 Mar 2019 02:27:56 +0000 (10:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Mar 2019 07:45:03 +0000 (16:45 +0900)
commit4d537f37e0d39f64687be71087dca607ee507f5a
tree9135adefda02e372d0d0286098e05ddf6d301ff0
parent2a738137b4c2dfddae03cd44f5b5f24f745c2864
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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