summaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorPeng Fan <fanpeng@loongson.cn>2020-07-02 16:58:52 +0800
committerSebastian Reichel <sebastian.reichel@collabora.com>2020-07-28 02:18:24 +0200
commit466bf93153b871f9fed93aea1389673c17d253e7 (patch)
tree9f26b2ed8190b11fbd8b2e54787f49ca7c79b1e4 /drivers/power
parent2f38dc4d9190cd97b8ceb88be5b835ee5feb44d1 (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.c2
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,