From patchwork Fri Sep 18 09:10:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 1366684 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=mediatek.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=mediatek.com header.i=@mediatek.com header.a=rsa-sha256 header.s=dk header.b=eDbANjwR; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bt7Qt2lC2z9sSf for ; Fri, 18 Sep 2020 19:12:54 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DEA6B82432; Fri, 18 Sep 2020 11:12:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=mediatek.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=mediatek.com header.i=@mediatek.com header.b="eDbANjwR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0E75082433; Fri, 18 Sep 2020 11:12:48 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MIME_BASE64_TEXT,RDNS_NONE,SPF_HELO_NONE, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by phobos.denx.de (Postfix) with ESMTP id 5C50C8242E for ; Fri, 18 Sep 2020 11:12:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=mediatek.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=chunfeng.yun@mediatek.com X-UUID: b5e62392df5c4fd897bc126d23b6f334-20200918 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=DDRdnDwsdYyQg/wwyNmKn9Q4GzGCzClBwCYNNIs59Vc=; b=eDbANjwR03bh3YNkO5pO4B29GHskWXEwyv2PDz2h0Ds2UVZxnBMNo+ZtGr4g69isaoRnKRFMV8PH3ETF/oxS42M/C/BUz5IQvsvqwkrbmKHA+xY2qBV3WrViWvieoCAg3GOiqCAHQ5hlr7MZa4+x/I05058/K/yuqLXW+ai5jcw=; X-UUID: b5e62392df5c4fd897bc126d23b6f334-20200918 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1718502011; Fri, 18 Sep 2020 17:12:40 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 18 Sep 2020 17:12:38 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 18 Sep 2020 17:12:36 +0800 From: Chunfeng Yun To: Marek Vasut , Lukasz Majewski , Bin Meng CC: Mingming lee , Ryder Lee , Weijie Gao , Chunfeng Yun , GSS_MTK_Uboot_upstream , Heinrich Schuchardt , Lokesh Vutla , Simon Glass , Stefan Roese , Michal Simek , Stefan Bosch , Alex Nemirovsky , Rayagonda Kokatanur , Patrice Chotard , Sam Protsenko , Priyanka Jain , Amit Singh Tomar , Kever Yang , Jagan Teki , Frank Wang , T Karthik Reddy , Siva Durga Prasad Paladugu , Roger Quadros , , Tom Rini , Frank Wunderlich Subject: [PATCH next v7 04/10] usb: common: add define of usb_speed_string() Date: Fri, 18 Sep 2020 17:10:07 +0800 Message-ID: <1600420213-25974-5-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1600420213-25974-1-git-send-email-chunfeng.yun@mediatek.com> References: <1600420213-25974-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: F26DA8341609964061CDE04A7A7A9EFA25923F730E7362488CAFFBFE102814AC2000:8 X-MTK: N X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean 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 Reviewed-by: Bin Meng --- 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.