From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: u-boot@lists.denx.de
Subject: [PATCH next v7 04/10] usb: common: add define of usb_speed_string()
Date: Fri, 18 Sep 2020 17:10:07 +0800 [thread overview]
Message-ID: <1600420213-25974-5-git-send-email-chunfeng.yun@mediatek.com> (raw)
In-Reply-To: <1600420213-25974-1-git-send-email-chunfeng.yun@mediatek.com>
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>
---
v7: no changes
v6: modify commit message suggested by Roger
v5: no changes
v4: new patch
---
drivers/usb/common/common.c | 7 +++++++
include/linux/usb/ch9.h | 4 ----
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/common/common.c b/drivers/usb/common/common.c
index 76f5a9c..5e5c3c3 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;
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h
index 7d225ee..a8fa5d7 100644
--- a/include/linux/usb/ch9.h
+++ b/include/linux/usb/ch9.h
@@ -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.
--
1.9.1
next prev parent reply other threads:[~2020-09-18 9:10 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-18 9:10 [PATCH next v7 00/10] Add support MediaTek USB3 DRD driver Chunfeng Yun
2020-09-18 9:10 ` [PATCH next v7 01/10] dt-binding: usb: add bindings for some common properties Chunfeng Yun
2020-10-13 14:15 ` Bin Meng
2020-09-18 9:10 ` [PATCH next v7 02/10] dt-bindings: usb: mtu3: add bindings for MediaTek USB3 DRD Chunfeng Yun
2020-10-13 14:18 ` Bin Meng
2020-10-14 2:46 ` Chunfeng Yun
2020-09-18 9:10 ` [PATCH next v7 03/10] usb: add USB_SPEED_SUPER_PLUS Chunfeng Yun
2020-10-13 14:19 ` Bin Meng
2020-10-14 2:50 ` Chunfeng Yun
2020-09-18 9:10 ` Chunfeng Yun [this message]
2020-10-13 14:21 ` [PATCH next v7 04/10] usb: common: add define of usb_speed_string() Bin Meng
2020-09-18 9:10 ` [PATCH next v7 05/10] usb: add MediaTek USB3 DRD driver Chunfeng Yun
2020-10-13 14:26 ` Bin Meng
2020-10-14 3:15 ` Chunfeng Yun
2020-09-18 9:10 ` [PATCH next v7 06/10] usb: gadget: Add bcdDevice for the MTU3 USB Gadget Controller Chunfeng Yun
2020-10-13 14:28 ` Bin Meng
2020-09-18 9:10 ` [PATCH next v7 07/10] arm: dts: mt8512: add usb related nodes Chunfeng Yun
2020-10-13 14:32 ` Bin Meng
2020-09-18 9:10 ` [PATCH next v7 08/10] configs: mt8512: enable fastboot Chunfeng Yun
2020-09-18 9:10 ` [PATCH next v7 09/10] configs: mt8512: add USB host related configs Chunfeng Yun
2020-10-13 14:34 ` Bin Meng
2020-10-14 3:40 ` Chunfeng Yun
2020-09-18 9:10 ` [PATCH next v7 10/10] MAINTAINERS: add USB driver to ARM MEDIATEK Chunfeng Yun
2020-10-13 14:35 ` Bin Meng
2020-09-28 2:01 ` [PATCH next v7 00/10] Add support MediaTek USB3 DRD driver Chunfeng Yun
2020-09-28 2:12 ` Marek Vasut
2020-09-28 2:20 ` Chunfeng Yun
2020-10-13 7:26 ` Chunfeng Yun
2020-10-13 10:27 ` Bin Meng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1600420213-25974-5-git-send-email-chunfeng.yun@mediatek.com \
--to=chunfeng.yun@mediatek.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.