Commit d92e866f authored by Chunfeng Yun's avatar Chunfeng Yun Committed by Marek Vasut

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: default avatarChunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: Bin Meng's avatarBin Meng <bmeng.cn@gmail.com>
parent a4de6e38
......@@ -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;
......
......@@ -959,8 +959,6 @@ enum usb_device_speed {
USB_SPEED_SUPER_PLUS, /* usb 3.1 */
};
#ifdef __KERNEL__
/**
* usb_speed_string() - Returns human readable-name of the speed.
* @speed: The speed to return human-readable name for. If it's not
......@@ -969,8 +967,6 @@ enum usb_device_speed {
*/
extern const char *usb_speed_string(enum usb_device_speed speed);
#endif
enum usb_device_state {
/* NOTATTACHED isn't in the USB spec, and this state acts
* the same as ATTACHED ... but it's clearer this way.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment