diff options
| author | Chunfeng Yun <[email protected]> | 2020-10-14 15:08:28 +0800 |
|---|---|---|
| committer | Marek Vasut <[email protected]> | 2020-10-20 00:49:05 +0200 |
| commit | d92e866f6008fdd6483735c6fd1ed95c8fdc87b1 (patch) | |
| tree | 2f57e17650be108d7fa3e139934ef62373a24b31 /drivers | |
| parent | a4de6e380fd1078c3f06210a0be0f3f8a69062dc (diff) | |
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 <[email protected]>
Reviewed-by: Bin Meng <[email protected]>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/usb/common/common.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/common/common.c b/drivers/usb/common/common.c index 76f5a9ce60f..5e5c3c3e3dc 100644 --- a/drivers/usb/common/common.c +++ b/drivers/usb/common/common.c @@ -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; |
