Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp238341imw; Fri, 8 Jul 2022 01:57:08 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u11Yzu9A/eytdPu+CDkpki1jFvykDnlnzwzhavaX/dVhJe2jWGFZoFZ4kzT1xMC3LryXoF X-Received: by 2002:a17:902:d2cf:b0:16c:223e:a3e8 with SMTP id n15-20020a170902d2cf00b0016c223ea3e8mr2522190plc.125.1657270628554; Fri, 08 Jul 2022 01:57:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657270628; cv=none; d=google.com; s=arc-20160816; b=GHNkCUjnk9oWIuYnpnuueEWPPyFl6bs9B5Hz6/ucage6tJNDzYxUvtpG3Ox0/4Ne0Y Ci9tuqFoaoHkSJJoQrYf0aabDKwzY9OHuGyphNOSgAd7X0mDMYCI2w4fEJZPZYsMe0kq ++jv+yPebrjVv4pLn8KvFDlFngs/Z22emIy30QwTbTDi8S/HJNUKj1D+KlALEf5zhJNF PL5R+bQwyCU4RUUp7Q3Wgm/XNMKbIndqZ8UJnW/DtSskPF4HO4KFDdwpjLQOm/D8BMaM 1c/ZGWhDgy8eheVXuRah4+uf9IsL3HL8LJvJdbxbKQHiWGbmUOehx/MB7uuVlOVisKRb UoAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject; bh=b4lVeyc5K5JX1K4ztf0swTSEaXeumL1HhkTpwdlLEog=; b=apFap7pMnRfOT7WKeBZU4TJuBy6Wuk9tojnkqTT1MVFxn5EVi3AIe7kM1JzOzGtMuT LJRkKyuYRl/Q4LyRo9PgGeWJcrEzuEb2fiuuDGYkAf9VQlvUvAwL7D9stS/z3M6IdOgW +vRstAqMq46afKiDfppeROsmT460Vaw8euif//LzC0Snr6dDvII3gheH+S384JIMsSQ/ Wqb02OCzq5WmEoNmNABW5n3Cu0Sl5HwwDDGBy4S6gbqcvZtwAe1P3DjjuI8YFvVyDpAz WZ68CQZCv1sQOKI1FQi6yWFKcfcaHY4SkFn04sNBCWYQj41O5sNrTNBruzLfcWhFy5wp 1O7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r22-20020a632b16000000b0041282c3315fsi12285120pgr.783.2022.07.08.01.56.56; Fri, 08 Jul 2022 01:57:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237239AbiGHIq5 (ORCPT + 99 others); Fri, 8 Jul 2022 04:46:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236513AbiGHIq4 (ORCPT ); Fri, 8 Jul 2022 04:46:56 -0400 Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37A01823B2; Fri, 8 Jul 2022 01:46:53 -0700 (PDT) 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 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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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