diff options
author | Peng Fan <fanpeng@loongson.cn> | 2020-07-02 16:58:52 +0800 |
---|---|---|
committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2020-07-28 02:18:24 +0200 |
commit | 466bf93153b871f9fed93aea1389673c17d253e7 (patch) | |
tree | 9f26b2ed8190b11fbd8b2e54787f49ca7c79b1e4 /drivers/power | |
parent | 2f38dc4d9190cd97b8ceb88be5b835ee5feb44d1 (diff) |
power: supply: rt5033_battery: Fix error code in rt5033_battery_probe()
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>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/supply/rt5033_battery.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/supply/rt5033_battery.c b/drivers/power/supply/rt5033_battery.c index d8667a9fc49b..f330452341f0 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, |