All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Michael Grzeschik <m.grzeschik@pengutronix.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel@pengutronix.de
Subject: Re: [PATCH] usb: typec: mux: do not return on EOPNOTSUPP in {mux, switch}_set
Date: Mon, 7 Apr 2025 15:52:18 +0300	[thread overview]
Message-ID: <Z_PKgnPDpWPrrEK3@kuha.fi.intel.com> (raw)
In-Reply-To: <20250404-ml-topic-typec-mux-v1-1-22c0526381ba@pengutronix.de>

On Fri, Apr 04, 2025 at 12:21:01AM +0200, Michael Grzeschik wrote:
> Since the typec connectors can have many muxes or switches for different
> lanes (sbu, usb2, usb3) going into different modal states (usb2, usb3,
> audio, debug) all of them will be called on typec_switch_set and
> typec_mux_set. But not all of them will be handling the expected mode.
> 
> If one of the mux or switch will come back with EOPTNOSUPP this is no
> reason to stop running through the next ones. Therefor we skip this
> particular error value and continue calling the next.
> 
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/mux.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/typec/mux.c b/drivers/usb/typec/mux.c
> index 49926d6e72c71..182c902c42f61 100644
> --- a/drivers/usb/typec/mux.c
> +++ b/drivers/usb/typec/mux.c
> @@ -214,7 +214,7 @@ int typec_switch_set(struct typec_switch *sw,
>  		sw_dev = sw->sw_devs[i];
>  
>  		ret = sw_dev->set(sw_dev, orientation);
> -		if (ret)
> +		if (ret && ret != -EOPNOTSUPP)
>  			return ret;
>  	}
>  
> @@ -378,7 +378,7 @@ int typec_mux_set(struct typec_mux *mux, struct typec_mux_state *state)
>  		mux_dev = mux->mux_devs[i];
>  
>  		ret = mux_dev->set(mux_dev, state);
> -		if (ret)
> +		if (ret && ret != -EOPNOTSUPP)
>  			return ret;
>  	}

thanks,

-- 
heikki

      reply	other threads:[~2025-04-07 12:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-03 22:21 [PATCH] usb: typec: mux: do not return on EOPNOTSUPP in {mux, switch}_set Michael Grzeschik
2025-04-07 12:52 ` Heikki Krogerus [this message]

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=Z_PKgnPDpWPrrEK3@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=m.grzeschik@pengutronix.de \
    /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.