[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zmb5dVRz46szJtHc@kuha.fi.intel.com>
Date: Mon, 10 Jun 2024 16:02:45 +0300
From: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To: Neil Armstrong <neil.armstrong@...aro.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Bjorn Andersson <andersson@...nel.org>,
Luca Weiss <luca.weiss@...rphone.com>,
linux-arm-msm@...r.kernel.org, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/4] usb: typec-mux: nb7vpq904m: unregister typec
switch on probe error and remove
On Thu, Jun 06, 2024 at 03:11:14PM +0200, Neil Armstrong wrote:
> Add the missing call to typec_switch_put() when probe fails and
> the nb7vpq904m_remove() call is called.
>
> Fixes: 348359e7c232 ("usb: typec: nb7vpq904m: Add an error handling path in nb7vpq904m_probe()")
> Signed-off-by: Neil Armstrong <neil.armstrong@...aro.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
> ---
> drivers/usb/typec/mux/nb7vpq904m.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/typec/mux/nb7vpq904m.c b/drivers/usb/typec/mux/nb7vpq904m.c
> index ed93194b16cf..569f1162ee2e 100644
> --- a/drivers/usb/typec/mux/nb7vpq904m.c
> +++ b/drivers/usb/typec/mux/nb7vpq904m.c
> @@ -415,7 +415,7 @@ static int nb7vpq904m_probe(struct i2c_client *client)
>
> ret = nb7vpq904m_parse_data_lanes_mapping(nb7);
> if (ret)
> - return ret;
> + goto err_switch_put;
>
> ret = regulator_enable(nb7->vcc_supply);
> if (ret)
> @@ -458,6 +458,9 @@ static int nb7vpq904m_probe(struct i2c_client *client)
> gpiod_set_value(nb7->enable_gpio, 0);
> regulator_disable(nb7->vcc_supply);
>
> +err_switch_put:
> + typec_switch_put(nb7->typec_switch);
> +
> return ret;
> }
>
> @@ -471,6 +474,8 @@ static void nb7vpq904m_remove(struct i2c_client *client)
> gpiod_set_value(nb7->enable_gpio, 0);
>
> regulator_disable(nb7->vcc_supply);
> +
> + typec_switch_put(nb7->typec_switch);
> }
>
> static const struct i2c_device_id nb7vpq904m_table[] = {
>
> --
> 2.34.1
--
heikki
Powered by blists - more mailing lists