Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2387862pxj; Mon, 31 May 2021 00:26:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwl/SfebM+LI43rj53E+GlhWvjl3utT1mrOPzYe77e2z9l0mQcN5dMUOSZ9LrvNSWHg3eS1 X-Received: by 2002:a05:6402:3546:: with SMTP id f6mr24032986edd.267.1622445998143; Mon, 31 May 2021 00:26:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622445998; cv=none; d=google.com; s=arc-20160816; b=nMaNKxEvNWbhtuJeYcgPjH/kXjx+hXYeooOb8xnP2jeapLNs7qjwu2lSK9+oKTPDYF eMg1npTm4Itt3FJ8VWO3DT+zGYi0p2vhlNlbADQhgrLgcW7ZLWNuN3NC2wJvI0QLrAw7 7RhqUdMNsxL5g6sBXW1XBKjnA2RyS4rjcaA+J+w6c63GLe1xGDtHODzMG2ImKxTG6Wzt eg1z7kBzhmTV6JLYmCOg/NeJSGiqRhVYOKwpmUf+FnnEyvdp0dcMjwB9GyfOLmIiAKp6 fWxt6heuSIwXEU7GYZtCN4gfCcLcR1tyg00Q5yonH502SRZogqCVUV4rqvCTS6++erW0 Z9vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:ironport-sdr :ironport-sdr; bh=jk9nPrnvJUbr3RCvBMVJh3Ud7FD8wQN64Se2qyOnymY=; b=KdCGBgwU2fqgJyDHUv1wwyJgt6dHhoo+JeFBKy45NqAaS6z5gYtwMaBZZ9ubGzOiQJ jXRUaDl031Uh3BAPaW6l5P40qwbgS3cnqjeDO08ydoiF6LMGLW7apXI9MYsFpV/8K1tE yj+enbZaE/L9l50aT/JMADeo6qcfY4p6C/rZjL332BiP9bhlCZQZTID+ZdHAifuUMl0S j15ClzZZCEG7uXbxdy9ZRblw5lXcrks6AgUq3DxE234ym3OW7kWrfUHwY88MiDoncg7m bHNK6k0865oLO4aC+ocRk0Y2YBdi/AsuU6fJoouM16AgY9X0fZgSHdZmzOPGP76gsM/p Ltvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y8si3584187edw.228.2021.05.31.00.26.15; Mon, 31 May 2021 00:26:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230250AbhEaH0T (ORCPT + 99 others); Mon, 31 May 2021 03:26:19 -0400 Received: from mga01.intel.com ([192.55.52.88]:15403 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230243AbhEaH0Q (ORCPT ); Mon, 31 May 2021 03:26:16 -0400 IronPort-SDR: faWAdosKWOr2j3fnMnwGFkLhoyyvdyfEkuRe479N0mqx1BooIBVoj7Ry5xBSmSvDSIUiWBxHct aXyRH0576u8Q== X-IronPort-AV: E=McAfee;i="6200,9189,10000"; a="224579964" X-IronPort-AV: E=Sophos;i="5.83,236,1616482800"; d="scan'208";a="224579964" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2021 00:24:34 -0700 IronPort-SDR: 5mCjVwBtiV3M+fkTUXd1gBdyjpQRkPKVFBDDKL/kf2RIV59Rwm9Tnj03BkeYQBQyvlyyvC8AzT z9Ys9jbgxBLQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,236,1616482800"; d="scan'208";a="549328989" Received: from kuha.fi.intel.com ([10.237.72.162]) by fmsmga001.fm.intel.com with SMTP; 31 May 2021 00:24:32 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Mon, 31 May 2021 10:24:31 +0300 Date: Mon, 31 May 2021 10:24:31 +0300 From: Heikki Krogerus To: Jun Li , Greg Kroah-Hartman Cc: Hans de Goede , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 2/2] usb: typec: mux: Remove requirement for the "orientation-switch" device property Message-ID: References: <20210526153548.61276-1-heikki.krogerus@linux.intel.com> <20210526153548.61276-3-heikki.krogerus@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 28, 2021 at 07:26:43AM +0000, Jun Li wrote: > Hi, > > -----Original Message----- > > From: Heikki Krogerus > > Sent: Wednesday, May 26, 2021 11:36 PM > > To: Greg Kroah-Hartman ; Hans de Goede > > ; Jun Li > > Cc: linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org > > Subject: [PATCH 2/2] usb: typec: mux: Remove requirement for the > > "orientation-switch" device property > > > > The additional boolean device property "orientation-switch" > > is not needed when the connection is described with device graph, so removing > > the check and the requirement for it. > > > > Signed-off-by: Heikki Krogerus > > --- > > drivers/usb/typec/mux.c | 3 --- > > 1 file changed, 3 deletions(-) > > > > diff --git a/drivers/usb/typec/mux.c b/drivers/usb/typec/mux.c index > > e40a555724fb6..603f3e698cc0b 100644 > > --- a/drivers/usb/typec/mux.c > > +++ b/drivers/usb/typec/mux.c > > @@ -30,9 +30,6 @@ static void *typec_switch_match(struct fwnode_handle > > *fwnode, const char *id, { > > struct device *dev; > > > > - if (id && !fwnode_property_present(fwnode, id)) > > - return NULL; > > - > > May this change the result of fwnode_connection_find_match() > if there are multiple remote-endpoint node? > > After the 2 patches change, typec_switch_match() will never > return NULL, so > > 17 static void * > 18 fwnode_graph_devcon_match(struct fwnode_handle *fwnode, const char *con_id, > 19 void *data, devcon_match_fn_t match) > 20 { > 21 struct fwnode_handle *node; > 22 struct fwnode_handle *ep; > 23 void *ret; > 24 > 25 fwnode_graph_for_each_endpoint(fwnode, ep) { > 26 node = fwnode_graph_get_remote_port_parent(ep); > 27 if (!fwnode_device_is_available(node)) > 28 continue; > 29 > 30 ret = match(node, con_id, data);// ret can't be NULL; > 31 fwnode_handle_put(node); > 32 if (ret) { > /* > * So loop will go to here and stop > * checking next ep, even this ep > * actually is not for typec_switch > */ > 33 fwnode_handle_put(ep); > 34 return ret; > 35 } > 36 } > 37 return NULL; > 38 } > > fwnode_graph_devcon_match() Will return ERR_PTR(-EPROBE_DEFER) > even this ep's remote parent already probed but it's not for > typec_switch. You are correct. With device graph I guess we really always need the extra device property after all. So let's forget about this one. thanks, -- heikki