usb: common: add define of usb_speed_string()

There is only declaration of usb_speed_string(), but no definition,
so add it to avoid build error when call it.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
Chunfeng Yun
2020-10-14 15:08:28 +08:00
committed by Marek Vasut
parent a4de6e380f
commit d92e866f60
2 changed files with 7 additions and 4 deletions

View File

@@ -49,6 +49,13 @@ static const char *const speed_names[] = {
[USB_SPEED_SUPER_PLUS] = "super-speed-plus",
};
const char *usb_speed_string(enum usb_device_speed speed)
{
if (speed < 0 || speed >= ARRAY_SIZE(speed_names))
speed = USB_SPEED_UNKNOWN;
return speed_names[speed];
}
enum usb_device_speed usb_get_maximum_speed(ofnode node)
{
const char *max_speed;