Commit 466bf931 authored by Peng Fan's avatar Peng Fan Committed by Sebastian Reichel

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: default avatarPeng Fan <fanpeng@loongson.cn>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 2f38dc4d
...@@ -125,7 +125,7 @@ static int rt5033_battery_probe(struct i2c_client *client, ...@@ -125,7 +125,7 @@ static int rt5033_battery_probe(struct i2c_client *client,
battery = devm_kzalloc(&client->dev, sizeof(*battery), GFP_KERNEL); battery = devm_kzalloc(&client->dev, sizeof(*battery), GFP_KERNEL);
if (!battery) if (!battery)
return -EINVAL; return -ENOMEM;
battery->client = client; battery->client = client;
battery->regmap = devm_regmap_init_i2c(client, battery->regmap = devm_regmap_init_i2c(client,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment