public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Neil Armstrong <neil.armstrong@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Luca Weiss <luca.weiss@fairphone.com>,
	linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/4] usb: typec-mux: ptn36502: unregister typec switch on probe error and remove
Date: Mon, 10 Jun 2024 15:51:20 +0300	[thread overview]
Message-ID: <Zmb2yHkNe12ivAYY@kuha.fi.intel.com> (raw)
In-Reply-To: <20240606-topic-sm8x50-upstream-retimer-broadcast-mode-v2-1-c6f6eae479c3@linaro.org>

On Thu, Jun 06, 2024 at 03:11:13PM +0200, Neil Armstrong wrote:
> Add the missing call to typec_switch_put() when probe fails and
> the ptn36502_remove() call is called.
> 
> Fixes: 8e99dc783648 ("usb: typec: add support for PTN36502 redriver")
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>

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

> ---
>  drivers/usb/typec/mux/ptn36502.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/typec/mux/ptn36502.c b/drivers/usb/typec/mux/ptn36502.c
> index 0ec86ef32a87..88136a6d6f31 100644
> --- a/drivers/usb/typec/mux/ptn36502.c
> +++ b/drivers/usb/typec/mux/ptn36502.c
> @@ -322,8 +322,10 @@ static int ptn36502_probe(struct i2c_client *client)
>  				     "Failed to acquire orientation-switch\n");
>  
>  	ret = regulator_enable(ptn->vdd18_supply);
> -	if (ret)
> -		return dev_err_probe(dev, ret, "Failed to enable vdd18\n");
> +	if (ret) {
> +		ret = dev_err_probe(dev, ret, "Failed to enable vdd18\n");
> +		goto err_switch_put;
> +	}
>  
>  	ret = ptn36502_detect(ptn);
>  	if (ret)
> @@ -363,6 +365,9 @@ static int ptn36502_probe(struct i2c_client *client)
>  err_disable_regulator:
>  	regulator_disable(ptn->vdd18_supply);
>  
> +err_switch_put:
> +	typec_switch_put(ptn->typec_switch);
> +
>  	return ret;
>  }
>  
> @@ -374,6 +379,8 @@ static void ptn36502_remove(struct i2c_client *client)
>  	typec_switch_unregister(ptn->sw);
>  
>  	regulator_disable(ptn->vdd18_supply);
> +
> +	typec_switch_put(ptn->typec_switch);
>  }
>  
>  static const struct i2c_device_id ptn36502_table[] = {
> 
> -- 
> 2.34.1

-- 
heikki

  parent reply	other threads:[~2024-06-10 12:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-06 13:11 [PATCH v2 0/4] usb: typec-mux: broadcast typec state to next mux for ptn36502 & nb7vpq904m retimers Neil Armstrong
2024-06-06 13:11 ` [PATCH v2 1/4] usb: typec-mux: ptn36502: unregister typec switch on probe error and remove Neil Armstrong
2024-06-07  5:48   ` Dmitry Baryshkov
2024-06-10 12:51   ` Heikki Krogerus [this message]
2024-06-06 13:11 ` [PATCH v2 2/4] usb: typec-mux: nb7vpq904m: " Neil Armstrong
2024-06-07  5:50   ` Dmitry Baryshkov
2024-06-07 14:00     ` Neil Armstrong
2024-06-07 14:49       ` Dmitry Baryshkov
2024-06-10 13:02   ` Heikki Krogerus
2024-06-06 13:11 ` [PATCH v2 3/4] usb: typec-mux: ptn36502: broadcast typec state to next mux Neil Armstrong
2024-06-07  5:51   ` Dmitry Baryshkov
2024-06-10 13:04   ` Heikki Krogerus
2024-06-06 13:11 ` [PATCH v2 4/4] usb: typec-mux: nb7vpq904m: " Neil Armstrong
2024-06-07  5:55   ` Dmitry Baryshkov
2024-06-10 13:06   ` Heikki Krogerus

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=Zmb2yHkNe12ivAYY@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=andersson@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=luca.weiss@fairphone.com \
    --cc=neil.armstrong@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox