From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: Chris Morgan <macroalpha82@gmail.com>
Cc: linux-pm@vger.kernel.org, maccraft123mc@gmail.com,
lee@kernel.org, dan.carpenter@oracle.com,
Chris Morgan <macromorgan@hotmail.com>
Subject: Re: [PATCH] power: supply: Change rk817_chg_cur_to_reg to int
Date: Thu, 20 Oct 2022 01:45:05 +0200 [thread overview]
Message-ID: <20221019234505.5viojwmk6ksqr4gb@mercury.elektranox.org> (raw)
In-Reply-To: <20221010141329.10006-1-macroalpha82@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1847 bytes --]
Hi,
On Mon, Oct 10, 2022 at 09:13:29AM -0500, Chris Morgan wrote:
> From: Chris Morgan <macromorgan@hotmail.com>
>
> Change return value of rk817_chg_cur_to_reg from u8 to int. If the
> function fails to find a suitable value it returns a -EINVAL, but
> defined as a u8 it would not return correctly. Additionally, change
> defined variable that stores return value from u8 to int.
>
> Fixes: 11cb8da0189b (power: supply: Add charger driver for Rockchip
> RK817)
Wrong format, must be one line and title should be in quotes in
addition to the brackets. (I fixed this while applying)
> Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
Thanks, queued to fixes branch.
-- Sebastian
> drivers/power/supply/rk817_charger.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/power/supply/rk817_charger.c b/drivers/power/supply/rk817_charger.c
> index 635f051b0821..305354d99177 100644
> --- a/drivers/power/supply/rk817_charger.c
> +++ b/drivers/power/supply/rk817_charger.c
> @@ -121,7 +121,7 @@ struct rk817_charger {
> #define ADC_TO_CHARGE_UAH(adc_value, res_div) \
> (adc_value / 3600 * 172 / res_div)
>
> -static u8 rk817_chg_cur_to_reg(u32 chg_cur_ma)
> +static int rk817_chg_cur_to_reg(u32 chg_cur_ma)
> {
> if (chg_cur_ma >= 3500)
> return CHG_3_5A;
> @@ -864,8 +864,8 @@ static int rk817_battery_init(struct rk817_charger *charger,
> {
> struct rk808 *rk808 = charger->rk808;
> u32 tmp, max_chg_vol_mv, max_chg_cur_ma;
> - u8 max_chg_vol_reg, chg_term_i_reg, max_chg_cur_reg;
> - int ret, chg_term_ma;
> + u8 max_chg_vol_reg, chg_term_i_reg;
> + int ret, chg_term_ma, max_chg_cur_reg;
> u8 bulk_reg[2];
>
> /* Get initial plug state */
> --
> 2.25.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2022-10-19 23:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-10 14:13 [PATCH] power: supply: Change rk817_chg_cur_to_reg to int Chris Morgan
2022-10-19 23:45 ` Sebastian Reichel [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=20221019234505.5viojwmk6ksqr4gb@mercury.elektranox.org \
--to=sebastian.reichel@collabora.com \
--cc=dan.carpenter@oracle.com \
--cc=lee@kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=maccraft123mc@gmail.com \
--cc=macroalpha82@gmail.com \
--cc=macromorgan@hotmail.com \
/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;
as well as URLs for NNTP newsgroup(s).