All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jun Li <jun.li@nxp.com>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Hans de Goede <hdegoede@redhat.com>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH 2/2] usb: typec: mux: Remove requirement for the "orientation-switch" device property
Date: Fri, 28 May 2021 07:26:43 +0000	[thread overview]
Message-ID: <VI1PR04MB59350F5BC9129F9E0B21773889229@VI1PR04MB5935.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20210526153548.61276-3-heikki.krogerus@linux.intel.com>

Hi,
> -----Original Message-----
> From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Sent: Wednesday, May 26, 2021 11:36 PM
> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>; Hans de Goede
> <hdegoede@redhat.com>; Jun Li <jun.li@nxp.com>
> 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 <heikki.krogerus@linux.intel.com>
> ---
>  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.

Li Jun

>  	dev = class_find_device(&typec_mux_class, NULL, fwnode,
>  				switch_fwnode_match);
> 
> --
> 2.30.2


  reply	other threads:[~2021-05-28  7:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26 15:35 [PATCH 0/2] usb: typec: mux: a few improvements Heikki Krogerus
2021-05-26 15:35 ` [PATCH 1/2] usb: typec: mux: Use device type instead of device name for matching Heikki Krogerus
2021-05-31  7:30   ` Heikki Krogerus
2021-05-31  8:09     ` Hans de Goede
2021-05-26 15:35 ` [PATCH 2/2] usb: typec: mux: Remove requirement for the "orientation-switch" device property Heikki Krogerus
2021-05-28  7:26   ` Jun Li [this message]
2021-05-31  7:24     ` Heikki Krogerus
2021-05-31  7:57       ` Heikki Krogerus
2021-05-31  8:26         ` Heikki Krogerus
2021-05-31 11:08           ` Jun Li
2021-05-31 12:33             ` Heikki Krogerus
2021-05-26 16:38 ` [PATCH 0/2] usb: typec: mux: a few improvements Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VI1PR04MB59350F5BC9129F9E0B21773889229@VI1PR04MB5935.eurprd04.prod.outlook.com \
    --to=jun.li@nxp.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.