From: Sebastian Reichel <sre@kernel.org>
To: Peng Fan <fanpeng@loongson.cn>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
Xuefeng Li <lixuefeng@loongson.cn>,
Tiezhu Yang <yangtiezhu@loongson.cn>
Subject: Re: [PATCH] power: supply: rt5033_battery: Fix error code in rt5033_battery_probe()
Date: Tue, 28 Jul 2020 02:19:37 +0200 [thread overview]
Message-ID: <20200728001937.vtvneczrskc6cs4u@earth.universe> (raw)
In-Reply-To: <1593680332-31884-1-git-send-email-fanpeng@loongson.cn>
[-- Attachment #1: Type: text/plain, Size: 950 bytes --]
Hi,
On Thu, Jul 02, 2020 at 04:58:52PM +0800, Peng Fan wrote:
> In the function rt5033_battery_probe(), it should return -ENOMEM
> instead of -EINVAL when call function devm_kzalloc() failed.
>
> Signed-off-by: Peng Fan <fanpeng@loongson.cn>
> ---
Thanks, queued.
-- Sebastian
> drivers/power/supply/rt5033_battery.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/power/supply/rt5033_battery.c b/drivers/power/supply/rt5033_battery.c
> index d8667a9..f330452 100644
> --- a/drivers/power/supply/rt5033_battery.c
> +++ b/drivers/power/supply/rt5033_battery.c
> @@ -125,7 +125,7 @@ static int rt5033_battery_probe(struct i2c_client *client,
>
> battery = devm_kzalloc(&client->dev, sizeof(*battery), GFP_KERNEL);
> if (!battery)
> - return -EINVAL;
> + return -ENOMEM;
>
> battery->client = client;
> battery->regmap = devm_regmap_init_i2c(client,
> --
> 2.1.0
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2020-07-28 0:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-02 8:58 [PATCH] power: supply: rt5033_battery: Fix error code in rt5033_battery_probe() Peng Fan
2020-07-28 0:19 ` 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=20200728001937.vtvneczrskc6cs4u@earth.universe \
--to=sre@kernel.org \
--cc=fanpeng@loongson.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lixuefeng@loongson.cn \
--cc=yangtiezhu@loongson.cn \
/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).