From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E7917A for ; Fri, 8 Jul 2022 09:02:02 +0000 (UTC) Received: from [192.168.1.103] (31.173.81.246) by msexch01.omp.ru (10.188.4.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.986.14; Fri, 8 Jul 2022 11:46:44 +0300 Subject: Re: [PATCH v3 2/9] usb: typec: Add retimer handle to port To: Prashant Malani , , , CC: , , Daisuke Nojiri , "Dustin L. Howett" , Greg Kroah-Hartman , Guenter Roeck , "Gustavo A. R. Silva" , Kees Cook , Sebastian Reichel , Tzung-Bi Shih References: <20220707222045.1415417-1-pmalani@chromium.org> <20220707222045.1415417-3-pmalani@chromium.org> From: Sergey Shtylyov Organization: Open Mobile Platform Message-ID: <509bf6fe-4406-c577-aa70-6eb70801e375@omp.ru> Date: Fri, 8 Jul 2022 11:46:44 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <20220707222045.1415417-3-pmalani@chromium.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [31.173.81.246] X-ClientProxiedBy: msexch01.omp.ru (10.188.4.12) To msexch01.omp.ru (10.188.4.12) X-KSE-ServerInfo: msexch01.omp.ru, 9 X-KSE-AntiSpam-Interceptor-Info: scan successful X-KSE-AntiSpam-Version: 5.9.20, Database issued on: 07/08/2022 08:32:48 X-KSE-AntiSpam-Status: KAS_STATUS_NOT_DETECTED X-KSE-AntiSpam-Method: none X-KSE-AntiSpam-Rate: 59 X-KSE-AntiSpam-Info: Lua profiles 171636 [Jul 08 2022] X-KSE-AntiSpam-Info: Version: 5.9.20.0 X-KSE-AntiSpam-Info: Envelope from: s.shtylyov@omp.ru X-KSE-AntiSpam-Info: LuaCore: 493 493 c80a237886b75a8eec705b487193915475443854 X-KSE-AntiSpam-Info: {rep_avail} X-KSE-AntiSpam-Info: {Tracking_from_domain_doesnt_match_to} X-KSE-AntiSpam-Info: {relay has no DNS name} X-KSE-AntiSpam-Info: {SMTP from is not routable} X-KSE-AntiSpam-Info: {Found in DNSBL: 31.173.81.246 in (user) b.barracudacentral.org} X-KSE-AntiSpam-Info: {Found in DNSBL: 31.173.81.246 in (user) dbl.spamhaus.org} X-KSE-AntiSpam-Info: 31.173.81.246:7.1.2;omp.ru:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2 X-KSE-AntiSpam-Info: ApMailHostAddress: 31.173.81.246 X-KSE-AntiSpam-Info: {DNS response errors} X-KSE-AntiSpam-Info: Rate: 59 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-AntiSpam-Info: Auth:dmarc=temperror header.from=omp.ru;spf=temperror smtp.mailfrom=omp.ru;dkim=none X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Heuristic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 07/08/2022 08:34:00 X-KSE-AttachmentFiltering-Interceptor-Info: protection disabled X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 7/8/2022 6:55:00 AM X-KSE-BulkMessagesFiltering-Scan-Result: InTheLimit Hello! On 7/8/22 1:20 AM, Prashant Malani wrote: > Similar to mux and orientation switch, add a handle for registered > retimer to the port, so that it has handles to the various switches > connected to it. > > Signed-off-by: Prashant Malani > --- > > Changes since v2: > - No changes. > > Changes since v1: > - Relinquish retimer reference during typec_release. > > drivers/usb/typec/class.c | 9 +++++++++ > drivers/usb/typec/class.h | 1 + > 2 files changed, 10 insertions(+) > > diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c > index 9062836bb638..f08e32d552b4 100644 > --- a/drivers/usb/typec/class.c > +++ b/drivers/usb/typec/class.c [...] > @@ -2249,6 +2251,13 @@ struct typec_port *typec_register_port(struct device *parent, > return ERR_PTR(ret); > } > > + port->retimer = typec_retimer_get(&port->dev); > + if (IS_ERR(port->retimer)) { > + ret = PTR_ERR(port->retimer); > + put_device(&port->dev); > + return ERR_PTR(ret); Why convert it to and fro, and not just return port->retimer? [...] MBR, Sergey