[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z1lY-9ik5T76U_Yn@kuha.fi.intel.com>
Date: Wed, 11 Dec 2024 11:18:51 +0200
From: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: Badhri Jagan Sridharan <badhri@...gle.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
André Draszik <andre.draszik@...aro.org>,
Guenter Roeck <linux@...ck-us.net>, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] usb: typec: tcpm/tcpci_maxim: fix error code in
max_contaminant_read_resistance_kohm()
On Fri, Dec 06, 2024 at 04:09:18PM +0300, Dan Carpenter wrote:
> If max_contaminant_read_adc_mv() fails, then return the error code. Don't
> return zero.
>
> Fixes: 02b332a06397 ("usb: typec: maxim_contaminant: Implement check_contaminant callback")
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
> ---
> drivers/usb/typec/tcpm/maxim_contaminant.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/typec/tcpm/maxim_contaminant.c b/drivers/usb/typec/tcpm/maxim_contaminant.c
> index 22163d8f9eb0..0cdda06592fd 100644
> --- a/drivers/usb/typec/tcpm/maxim_contaminant.c
> +++ b/drivers/usb/typec/tcpm/maxim_contaminant.c
> @@ -135,7 +135,7 @@ static int max_contaminant_read_resistance_kohm(struct max_tcpci_chip *chip,
>
> mv = max_contaminant_read_adc_mv(chip, channel, sleep_msec, raw, true);
> if (mv < 0)
> - return ret;
> + return mv;
>
> /* OVP enable */
> ret = regmap_update_bits(regmap, TCPC_VENDOR_CC_CTRL2, CCOVPDIS, 0);
> @@ -157,7 +157,7 @@ static int max_contaminant_read_resistance_kohm(struct max_tcpci_chip *chip,
>
> mv = max_contaminant_read_adc_mv(chip, channel, sleep_msec, raw, true);
> if (mv < 0)
> - return ret;
> + return mv;
> /* Disable current source */
> ret = regmap_update_bits(regmap, TCPC_VENDOR_CC_CTRL2, SBURPCTRL, 0);
> if (ret < 0)
> --
> 2.45.2
--
heikki
Powered by blists - more mailing lists