From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: "Badhri Jagan Sridharan" <badhri@google.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"André Draszik" <andre.draszik@linaro.org>,
"Guenter Roeck" <linux@roeck-us.net>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] usb: typec: tcpm/tcpci_maxim: fix error code in max_contaminant_read_resistance_kohm()
Date: Wed, 11 Dec 2024 11:18:51 +0200 [thread overview]
Message-ID: <Z1lY-9ik5T76U_Yn@kuha.fi.intel.com> (raw)
In-Reply-To: <f1bf3768-419e-40dd-989c-f7f455d6c824@stanley.mountain>
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@linaro.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.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
prev parent reply other threads:[~2024-12-11 9:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-06 13:09 [PATCH] usb: typec: tcpm/tcpci_maxim: fix error code in max_contaminant_read_resistance_kohm() Dan Carpenter
2024-12-09 10:06 ` André Draszik
2024-12-11 9:18 ` 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=Z1lY-9ik5T76U_Yn@kuha.fi.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=andre.draszik@linaro.org \
--cc=badhri@google.com \
--cc=dan.carpenter@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@roeck-us.net \
/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