Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6885070ybi; Mon, 8 Jul 2019 10:12:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzJt22UzecIXDl1vu+opY3SozieKjPmHFfpCqFGXDTM2YKNzBjHO5o0QG/3auRQuWYIbV7L X-Received: by 2002:a63:8f09:: with SMTP id n9mr24932157pgd.249.1562605945735; Mon, 08 Jul 2019 10:12:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562605945; cv=none; d=google.com; s=arc-20160816; b=Kd4/Dary0zZs2SurOabHXV0x1r/h/z2ezyUjsv5nnxR0vLmXgX2EJS0OkR0+d67Ri3 DIfK3Q7MZMstc8V+4UlBgJdTXYntUV8ddwK5CTK5C1TpUKD/PIA5J52nnCxl6/IRt3vg EWQKb4/4pdAEtcptRlAAWs1uZCvTvrcba6tL6xvPNGid5qvXOTtu7AKUTZFxsIMm24// o2i3sMTASXDtq2o3OoFMYIl66jbi/7eGB7clrA65CD/LJTTnJ1wAxAs5GTOAWRGfBLq5 UqQJTq0xDClJV7odNxk+0+HX7QoCMrQ5+fiJqxcdZTMAEGWGam1UEuprePDK0KhuKqGN 9S5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature :dkim-signature; bh=OWtTzM5NEKkAhBuHJ6CEEIzwpiU215SMMQ0HlfyVEro=; b=GFOTuWjSczVG87j2879ebkUuddr+fS79ZzSTuE7Jnky9k825e70PeFhJOV5hu2/H6q VbvSPA7oHqhwGLHY76+WhBnY6n2V3xrxpVYhp4RwROolEPzoWUTdubSit240lSVmlxqg qk3Tjdc+iNOMw3jzxeBUmj0jodc4W1IF6pK4faS+sQ2UvtAGOpnktTHHwf5InU+cSd8j wFzWd1FLHzWs2VO8vHpPXqT2Qb4682mI8lxKQmK0yxACKJY+5mp3JqYPOHFNLvO9NIX6 herR7sAeGtc4lyjHF+HL+OMNDNMNQnoUY1fBA/iIM0M25rLWjvCW7/DeFYTVEReSz517 jXuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cadence.com header.s=proofpoint header.b=V2GQD+cs; dkim=pass header.i=@cadence.com header.s=selector1 header.b=YrnJcoVd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cadence.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l184si16585731pgd.203.2019.07.08.10.12.10; Mon, 08 Jul 2019 10:12:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@cadence.com header.s=proofpoint header.b=V2GQD+cs; dkim=pass header.i=@cadence.com header.s=selector1 header.b=YrnJcoVd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cadence.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730796AbfGHMkW (ORCPT + 99 others); Mon, 8 Jul 2019 08:40:22 -0400 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]:59074 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727544AbfGHMkV (ORCPT ); Mon, 8 Jul 2019 08:40:21 -0400 Received: from pps.filterd (m0042385.ppops.net [127.0.0.1]) by mx0a-0014ca01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x68CbhTA008199; Mon, 8 Jul 2019 05:39:10 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=proofpoint; bh=OWtTzM5NEKkAhBuHJ6CEEIzwpiU215SMMQ0HlfyVEro=; b=V2GQD+csq3Jpga4hmpDUfZBjXr29HAbqHVVpjcTS9kmeM3RZzgMqeRvMBV2iG74KjBCw zT0/GjPHb72opNiVJblO6zEjlUycPCMS2/wNC4NaVQ5UvWeTWU0F7DbGrVdNQcRgWw7y zrn+hi3/pPgSebwWEXsWa/5Wrf2N7rOKOdPYr7Khoc2zAPEcJfsw00lIt0X9c5aUbYHT Qr5+irkr8kMDHmZj3kRyO8wHeDv//Q/IXpEmwy8z3qne2NfIOuv9TmxlGwx//T36retW VUM1G5n47F5nHW7NjKwZbietprEcHF55VNRFcB2PRRAiBf8DKgnXqRF21jyyuThaEEaZ Ag== Authentication-Results: cadence.com; spf=pass smtp.mailfrom=pawell@cadence.com Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2050.outbound.protection.outlook.com [104.47.36.50]) by mx0a-0014ca01.pphosted.com with ESMTP id 2tjr6vf109-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 08 Jul 2019 05:39:10 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OWtTzM5NEKkAhBuHJ6CEEIzwpiU215SMMQ0HlfyVEro=; b=YrnJcoVdjlPfCaRjrN6elr9XQ5dlYl7i6cD+uL4TxLtUDgbAVDqBtbVnMA0AOE7cMd3dRUVQrFMd0VDn+v07hQnUtHSj7c01OXzFNom1T1WXZCrdKrksogp2fL+pDzvvt4m+31X2B/3wsvqWOOK5f1rfFvNZ0tK/rXzN3mUkSZU= Received: from BYAPR07MB4709.namprd07.prod.outlook.com (52.135.204.159) by BYAPR07MB5957.namprd07.prod.outlook.com (20.179.92.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2052.18; Mon, 8 Jul 2019 12:39:07 +0000 Received: from BYAPR07MB4709.namprd07.prod.outlook.com ([fe80::fd8c:399c:929b:33e2]) by BYAPR07MB4709.namprd07.prod.outlook.com ([fe80::fd8c:399c:929b:33e2%6]) with mapi id 15.20.2052.020; Mon, 8 Jul 2019 12:39:07 +0000 From: Pawel Laszczak To: Felipe Balbi , "devicetree@vger.kernel.org" CC: "gregkh@linuxfoundation.org" , "linux-usb@vger.kernel.org" , "hdegoede@redhat.com" , "heikki.krogerus@linux.intel.com" , "robh+dt@kernel.org" , "rogerq@ti.com" , "linux-kernel@vger.kernel.org" , "jbergsagel@ti.com" , "nsekhar@ti.com" , "nm@ti.com" , Suresh Punnoose , "peter.chen@nxp.com" , Jayshri Dajiram Pawar , Rahul Kumar Subject: RE: [PATCH v9 5/6] usb:cdns3 Add Cadence USB3 DRD Driver Thread-Topic: [PATCH v9 5/6] usb:cdns3 Add Cadence USB3 DRD Driver Thread-Index: AQHVMyCBLRb+XoB9zUqxphM8AIPBC6a76sKAgAN7ISCAAOC4gIAAKa7ggAAmawCAAAZysIAABbSAgAAINMA= Date: Mon, 8 Jul 2019 12:39:07 +0000 Message-ID: References: <1562324238-16655-1-git-send-email-pawell@cadence.com> <1562324238-16655-6-git-send-email-pawell@cadence.com> <87r274lmqk.fsf@linux.intel.com> <87a7dpm442.fsf@linux.intel.com> <874l3wn5ep.fsf@linux.intel.com> <874l3whh4g.fsf@linux.intel.com> In-Reply-To: <874l3whh4g.fsf@linux.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-dg-ref: PG1ldGE+PGF0IG5tPSJib2R5LnR4dCIgcD0iYzpcdXNlcnNccGF3ZWxsXGFwcGRhdGFccm9hbWluZ1wwOWQ4NDliNi0zMmQzLTRhNDAtODVlZS02Yjg0YmEyOWUzNWJcbXNnc1xtc2ctNWQ2OGNmNmUtYTE3ZC0xMWU5LTg3NDItMWM0ZDcwMWRmYmE0XGFtZS10ZXN0XDVkNjhjZjZmLWExN2QtMTFlOS04NzQyLTFjNGQ3MDFkZmJhNGJvZHkudHh0IiBzej0iMjM5NiIgdD0iMTMyMDcwNjMxNDMyMDc4MzA5IiBoPSJQcmYyaUZtREprQU5xZVp0YlhCSEs5NU9CQzA9IiBpZD0iIiBibD0iMCIgYm89IjEiLz48L21ldGE+ x-dg-rorf: x-originating-ip: [59.145.174.78] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 09e880fd-e6f4-4231-d943-08d703a144cc x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020);SRVR:BYAPR07MB5957; x-ms-traffictypediagnostic: BYAPR07MB5957: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 00922518D8 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(4636009)(39860400002)(136003)(346002)(376002)(396003)(366004)(36092001)(199004)(189003)(76116006)(73956011)(5660300002)(52536014)(14454004)(186003)(6246003)(86362001)(66946007)(476003)(64756008)(66556008)(478600001)(107886003)(81166006)(66446008)(66476007)(81156014)(8676002)(26005)(76176011)(71200400001)(2906002)(4326008)(25786009)(7696005)(9686003)(55016002)(71190400001)(66066001)(6506007)(486006)(3846002)(7416002)(6116002)(33656002)(99286004)(68736007)(229853002)(54906003)(305945005)(2501003)(316002)(446003)(53936002)(74316002)(102836004)(110136005)(7736002)(256004)(14444005)(8936002)(11346002)(6436002);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR07MB5957;H:BYAPR07MB4709.namprd07.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: cadence.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: qtKswqepjimBkTueMiuLuawiw4FFibSoo/TL4/DBb5xWWlON2dMklIHz9JMZvz+lMh8P1036wCHCzi3Q4FE0ErgwihBA4BfhK20FHYK8Z+Pj7wBRF5O7d78lSWdkuhew8o71fM7ZhdLPXRf/zsmeQQeS0PhuGgx/D1V3we6QVRFIEOUl7ph3MncVfgKy592/X2KxBlG10qe3IyHgFyuP+eoPnZ1cho/yOqxh8UJ5MlAzOLSTNSSzwRn6jftj0OeJ0oSEs191iSoT+usBOgA5xjF3Te0MFRy4r78gJEey98rwxNAKHYQCoXBnbqImr9Z5aVGA4IPwg5sAXGTpTG1cURvGLfYKRy5kczbyRguDm7/47LAdSpts4htwSC1NpT+96R7v1uL9kl/AN7ujFnWe/lnbXv+S/tM1TW6KFewhcvg= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-Network-Message-Id: 09e880fd-e6f4-4231-d943-08d703a144cc X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jul 2019 12:39:07.3259 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: pawell@global.cadence.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR07MB5957 X-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 include:spf.smktg.jp include:_spf.salesforce.com include:mktomail.com include:spf-0014ca01.pphosted.com include:spf.protection.outlook.com include:auth.msgapp.com include:spf.mandrillapp.com ~all X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-07-08_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907080157 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > >(please send it as a formal patch from now on) I will send it. I think even today.=20 > >Hi, > >Pawel Laszczak writes: >> The prototype was added , but not all text was past. Sorry for that. >> >> Fixed version: with your changes. >> >> ///// v2 corrected >> commit 4553d48dd0500085d90c8280e28714072279c3dd (HEAD) >> Author: Pawel Laszczak >> Date: Mon Jul 8 12:53:47 2019 +0200 >> >> usb: common: Add usb_get_dr_mode_from_string and usb_dr_mode_to_stri= ng. >> >> Patch introduces new function usb_dr_mode_to_string for converting d= ual role >> mod to string and removes static from usb_dr_mode_to_string definiti= on. >> >> Both changes have made to avoid duplication of code by cdns3 driver. > >missing Signed-off-by > >> diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h >> index 69f1b6328532..c156817672c4 100644 >> --- a/include/linux/usb/otg.h >> +++ b/include/linux/usb/otg.h >> @@ -129,4 +129,20 @@ enum usb_dr_mode { >> */ >> extern enum usb_dr_mode usb_get_dr_mode(struct device *dev); >> >> +/** >> + * usb_get_dr_mode_from_string - Convert string to dual role mode. >> + * @str: Pointer to the given string >> + * >> + * The function gets string and returns the correspondig enum usb_dr_mo= de. >> + */ > >why duplicate the documentation? Perhaps put it only in the header, >otherwise we will need to update two locations whenever these functions >change. Ok, I've removed it from drviers/usb/common/common.c. > >> +extern enum usb_dr_mode usb_get_dr_mode_from_string(const char *str); >> + >> +/** >> + * usb_dr_mode_to_string - Convert dual role mode to string. >> + * @dr_mode: Pointer to the given dual role mode >> + * >> + * The function gets enum usb_dr_mode, and returns the correspondig str= ing. >> + */ >> +extern const char *usb_dr_mode_to_string(const enum usb_dr_mode dr_mode= ); > >Don't you need a stub for builds when CONFIG_USB_COMMON=3Dn? > We don't need it. It will be enabled when USB_GADGET or USB is enabled. It should cover all cases. =20 menuconfig USB_GADGET tristate "USB Gadget Support" select USB_COMMON config USB tristate "Support for Host-side USB" depends on USB_ARCH_HAS_HCD select USB_COMMON Pawel >-- >balbi